c1d5d469f7107a5a395c7915c0eff1696ebda7bb,tensorflow_datasets/testing/test_utils.py,MockFs,_open,#MockFs#Any#Any#,119

Before Change


  def _open(self, path, mode="r"):
    if mode == "w":
      self.add_file(path, "")
    with io.StringIO(self.files[path]) as f:
      yield f
      self.files[path] = f.getvalue()  // Update the content

After Change



    with fobj as f:
      yield f
      new_content = f.getvalue()  // Update the content

    self.files[path] = new_content.decode("utf-8") if is_binary else new_content  // pytype: disable=attribute-error

  def _rename(self, from_, to, overwrite=False):
    if not overwrite and to in self.files:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: tensorflow/datasets
Commit Name: c1d5d469f7107a5a395c7915c0eff1696ebda7bb
Time: 2020-05-15
Author: epot@google.com
File Name: tensorflow_datasets/testing/test_utils.py
Class Name: MockFs
Method Name: _open


Project Name: MLWave/kepler-mapper
Commit Name: 31b2885ad4068cc8a1316dfaf957a5235101822c
Time: 2017-11-13
Author: nat@saulgill.com
File Name: examples/digits/digits.py
Class Name:
Method Name:


Project Name: MLWave/kepler-mapper
Commit Name: 63cb99af2d065bdf8947eebfe6f58e2ce00339a1
Time: 2017-11-13
Author: nat@saulgill.com
File Name: examples/digits/digits.py
Class Name:
Method Name: