d7d9357b423e918d837101e727ced7159ec42149,tensorflow_datasets/core/shuffle.py,_Bucket,read_values,#_Bucket#,122

Before Change


      return []  // Nothing was written to this bucket.
    self._fobj.close()
    path = self._path
    res = []
    with tf.io.gfile.GFile(path, "rb") as fobj:
      while True:
        buff = fobj.read(HKEY_SIZE_BYTES)
        if not buff:
          break
        hkey = _read_hkey(buff)
        size_bytes = fobj.read(8)
        size = struct.unpack("=Q", size_bytes)[0]
        data = fobj.read(size)
        res.append((hkey, data))
    return res

  def del_file(self):
    if tf.io.gfile.exists(self._path):
      tf.io.gfile.remove(self._path)

After Change


        size_bytes = fobj.read(8)
        size = struct.unpack("=Q", size_bytes)[0]
        data = fobj.read(size)
        yield hkey, data

  def del_file(self):
    if tf.io.gfile.exists(self._path):
      tf.io.gfile.remove(self._path)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 7

Instances


Project Name: tensorflow/datasets
Commit Name: d7d9357b423e918d837101e727ced7159ec42149
Time: 2019-12-17
Author: pierrot@google.com
File Name: tensorflow_datasets/core/shuffle.py
Class Name: _Bucket
Method Name: read_values


Project Name: chartbeat-labs/textacy
Commit Name: 2cca6953b0d90832cabfab1a091ca0f6140eee42
Time: 2016-02-20
Author: burton@chartbeat.com
File Name: textacy/extract.py
Class Name:
Method Name: semistructured_statements


Project Name: chartbeat-labs/textacy
Commit Name: 2cca6953b0d90832cabfab1a091ca0f6140eee42
Time: 2016-02-20
Author: burton@chartbeat.com
File Name: textacy/extract.py
Class Name:
Method Name: direct_quotations


Project Name: chartbeat-labs/textacy
Commit Name: 2cca6953b0d90832cabfab1a091ca0f6140eee42
Time: 2016-02-20
Author: burton@chartbeat.com
File Name: textacy/extract.py
Class Name:
Method Name: subject_verb_object_triples


Project Name: erikbern/ann-benchmarks
Commit Name: 69b3611e0ff720c5b15a53f1d99b4c46d949a86f
Time: 2018-01-26
Author: mail@erikbern.com
File Name: ann_benchmarks/results.py
Class Name:
Method Name: load_results