def write(self, manifest: Mapping[str, int]):
    """Writes the manifest to the file."""
    try:
      # First attempt to delete the manifest if it exists in case it can't be
      # edited in-place.
      self._delete()
    except tf.errors.NotFoundError:
      pass
    self._open()
    # Manifests are small, so writing in a semi-human readable form (protocol=0)
    # is preferred over the efficiency gains of higher protocols.
    assert self._file is not None
    self._file.write(pickle.dumps(manifest, protocol=0))
Writes the manifest to the file.
tensorflow_transform/beam/analyzer_cache.py