class_docstr: A manifest file wrapper used to read and write tft cache manifest files.
class_docstr_tok: ["A","manifest","file","wrapper","used","to","read","and","write","tft","cache","manifest","files","."]
docstr: Reads, decodes and returns the manifest contents.
code: 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 {}
  
imports: import os
  import pickle
  import re
  import sys
  from typing import Iterable, Mapping, List, Optional, Union, Tuple
  import apache_beam
  import tensorflow
  from tfx_bsl.types import tfx_namedtuple
label_desc: Use image node_id 7 for calling the _ManifestFile obj's underlying member method code with example usage: obj._get_manifest_contents(manifest_file_handle) and returns: result, dict