Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def write(self, datum: typing.Dict[str, typing.Tuple[typing.Any, str]]) -> None:
"""Write an example into tfrecord file.
Params:
-------
datum: dict
Dictionary of tuples of form (value, dtype). dtype can be
"byte", "float" or "int".
"""
record = TFRecordWriter.serialize_tf_example(datum)
length = len(record)
length_bytes = struct.pack("