code: def load_inputs(
      signature_def: tf.compat.v1.MetaGraphDef.SignatureDefEntry,
      graph: tf.Graph,
  ) -> Tuple[Dict[str, types.TensorType], types.TensorType]:
      """Loads input nodes from signature_def.inputs.
  
      Args:
        signature_def: SignatureDef to lookup nodes in.
        graph: TensorFlow graph to lookup the nodes in.
  
      Returns:
        Tuple of (inputs_map, input_refs_node) where inputs_map is an OrderedDict.
  
      Raises:
        ValueError: If inputs or input_refs not found signature_def.inputs.
      """
      inputs = extract_signature_inputs_or_outputs_with_prefix(
          constants.SIGNATURE_DEF_INPUTS_PREFIX, signature_def.inputs
      )
      if not inputs:
          raise ValueError(
              "no inputs found in signature_def: %s" % signature_def
          )
      inputs_map = collections.OrderedDict()
      # Sort by key name so stable ordering is used when passing to feed_list.
      for k in sorted(inputs):
          inputs_map[
              k
          ] = tf.compat.v1.saved_model.utils.get_tensor_from_tensor_info(
              inputs[k], graph
          )
  
      if (
          constants.SIGNATURE_DEF_INPUT_REFS_KEY
          not in signature_def.inputs
      ):
          raise ValueError(
              "no input_refs found in signature_def: %s" % signature_def
          )
      input_refs_node = (
          tf.compat.v1.saved_model.utils.get_tensor_from_tensor_info(
              signature_def.inputs[
                  constants.SIGNATURE_DEF_INPUT_REFS_KEY
              ],
              graph,
          )
      )
      return (inputs_map, input_refs_node)
  
imports: import collections
  from typing import Dict, List, Optional, Tuple, Union
  import tensorflow
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.eval_saved_model import constants
  from tensorflow_model_analysis.eval_saved_model import encoding
  from tensorflow_model_analysis.eval_saved_model import util
  from google.protobuf import any_pb2
  from tensorflow.core.protobuf import meta_graph_pb2
label_desc: Use image node_id 5 for calling a global function with example usage: load_inputs(signature_def, graph) and returns: inputs_map,  input_refs_node