def _get_manifest_contents(self, manifest_file_handle) -> Mapping[str, int]:
    """Reads, decodes and returns the manifest contents."""
    manifest_file_handle.seek(0)
    try:
      result = pickle.loads(manifest_file_handle.read())
      assert isinstance(result, dict)
      return result
    except Exception as e:  # pylint: disable=broad-except
      # Any exception at this point would be an indication that the cache is
      # likely invalidated. Returning an empty dict allows the pipeline to
      # "gracefully" recover (by proceeding without cache) as opposed to
      # entering a crash-loop it can't recover from.
      tf.compat.v1.logging.error('Can\'t load cache manifest contents: %s',
                                 str(e))
      return {}
Reads, decodes and returns the manifest contents.
tensorflow_transform/beam/analyzer_cache.py