code: def singleprint_from_saved_model(export_dir: str) -> str:
      """Returns the singleprint of the SavedModel in `export_dir`.
  
      First tries to construct the singleprint from `fingerprint.pb`, then from
      `saved_model.pb`. Attempts to write the `fingerprint.pb` if not found, but
      doesn't return an error if it isn't writeable.
  
      Args:
        export_dir: The directory that contains the SavedModel.
  
      Returns:
        A string containing the singleprint of the SavedModel in `export_dir`.
  
      Raises:
        ValueError: If a valid singleprint cannot be constructed from the
        SavedModel.
      """
      # try generating the singleprint from `fingerprint.pb`
      try:
          return singleprint_from_fingerprint_proto(export_dir)
      except ValueError:
          pass
  
      # try creating `fingerprint.pb`, then generating the singleprint
      try:
          write_fingerprint(export_dir)
          return singleprint_from_fingerprint_proto(export_dir)
      except ValueError:
          pass
  
      # try generating the singleprint from `saved_model.pb`
      try:
          return singleprint_from_saved_model_proto(export_dir)
      except ValueError as e:
          raise ValueError(e) from None
  
file_path: tensorflow/tensorflow/python/saved_model/fingerprinting_utils.py
imports: from absl import logging
  from tensorflow.core.config import flags
  from tensorflow.core.protobuf import fingerprint_pb2
  from tensorflow.python.lib.io import file_io
  from tensorflow.python.saved_model import fingerprinting
  from tensorflow.python.saved_model.pywrap_saved_model import constants
  from tensorflow.python.saved_model.pywrap_saved_model import fingerprinting
  from tensorflow.python.saved_model.pywrap_saved_model import metrics
  from tensorflow.python.util import compat
label_desc: Use image node_id 4 for calling a global function with example usage: singleprint_from_saved_model(export_dir) and returns: singleprint_from_fingerprint_proto, singleprint_from_fingerprint_proto, singleprint_from_saved_model_proto