33dc406485d7e7bd829ebac07085f4c262e74280,tensorflow_datasets/core/hashing.py,,_to_bytes,#Any#,58

Before Change


    // For windows compatibility, we normalize the key in case a
    // filepath is passed as key ("path\\to\\file" -> "path/to/file")
    data = data.replace("\\", "/")
  return tf.compat.as_bytes(data)


class Hasher(object):
  Hasher: to initialize a md5 with salt.

After Change


def _to_bytes(data: HashKey) -> bytes:
  Converts the key to bytes.
  if isinstance(data, bytes):
    return data
  elif isinstance(data, str):
    // For windows compatibility, we normalize the key in case a
    // filepath is passed as key ("path\\to\\file" -> "path/to/file")
    data = data.replace("\\", "/")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: tensorflow/datasets
Commit Name: 33dc406485d7e7bd829ebac07085f4c262e74280
Time: 2020-12-07
Author: epot@google.com
File Name: tensorflow_datasets/core/hashing.py
Class Name:
Method Name: _to_bytes


Project Name: tensorflow/hub
Commit Name: 6fa628a1cb68800faaedc98ce6f448bf0c3bfb9f
Time: 2020-02-18
Author: no-reply@google.com
File Name: tensorflow_hub/tf_utils.py
Class Name:
Method Name: get_temp_export_dir


Project Name: tensorflow/datasets
Commit Name: 2e9b9eb7ff18fc9f9b4f4ae5becdc071ebf720ca
Time: 2019-05-16
Author: epot@google.com
File Name: tensorflow_datasets/core/features/text_feature.py
Class Name: Text
Method Name: encode_example