code: def get_signatures_from_saved_model(
      saved_model_path: str,
      signature_keys: Optional[Sequence[str]] = None,
      tags: Optional[Collection[str]] = None,
  ) -> Dict[str, meta_graph_pb2.SignatureDef]:
      """Gets a map from signature keys to their SignatureDef.
  
      Args:
        saved_model_path: Path to the saved model.
        signature_keys: List of keys identifying SignatureDef to retrieve. If None,
          retrieve all except the init signature.
        tags: Set of tags identifying the MetaGraphDef within the SavedModel.
  
      Returns:
        A map from signature_key to its SignatureDef.
      """
      if tags is None:
          tags = {tag_constants.SERVING}
  
      loader = saved_model_loader.SavedModelLoader(saved_model_path)
      meta_graphdef = loader.get_meta_graph_def_from_tags(tags)
      signatures = {}
      for key, signature_def in meta_graphdef.signature_def.items():
          if key == saved_model_constants.INIT_OP_SIGNATURE_KEY:
              continue
          if signature_keys is not None and key not in signature_keys:
              continue
          signatures[key] = signature_def
  
      return signatures
  
imports: from typing import Collection, Dict, Mapping, Optional, Sequence
  from absl import logging
  from google.protobuf.any_pb2 import Any
  from tensorflow.core.framework import graph_pb2
  from tensorflow.core.protobuf import meta_graph_pb2
  from tensorflow.core.protobuf import saver_pb2
  from tensorflow.python.client import session
  from tensorflow.python.framework import importer
  from tensorflow.python.framework import ops
  from tensorflow.python.lib.io import file_io
  from tensorflow.python.saved_model import builder
  from tensorflow.python.saved_model import constants
  from tensorflow.python.saved_model import loader_impl
  from tensorflow.python.saved_model import tag_constants
  from tensorflow.python.training import saver
label_desc: Use image node_id 1 for calling a global function with example usage: get_signatures_from_saved_model(saved_model_path, signature_keys, tags) and returns: signatures