code: def _restore_from_v1_saved_model(
      restored_function: function.ConcreteFunction, saved_model_dir: str
  ) -> Tuple[
      function.ConcreteFunction,
      Mapping[str, Any],
      Mapping[str, common_types.TensorType],
  ]:
      """Restores an exported TF1 compat SavedModel."""
      saved_model = saved_model_loader.parse_saved_model(
          saved_model_dir
      )
      meta_graph_def = (
          saved_model_loader.choose_meta_graph_def_and_raise(
              saved_model
          )
      )
      signature = meta_graph_def.signature_def[
          constants.TRANSFORM_SIGNATURE
      ]
      # Re-register pyfuncs, if any.
      graph_def = pyfunc_helper.register_pyfuncs_from_saved_transform(
          restored_function.graph, meta_graph_def, loaded_in_tf2=True
      )
      if graph_def is None:
          return (
              restored_function,
              signature.inputs,
              restored_function.structured_outputs,
          )
  
      inputs = [t.name for t in restored_function.graph.inputs]
      outputs = [t.name for t in restored_function.graph.outputs]
      wrapped = wrap_function.function_from_graph_def(
          graph_def, inputs, outputs
      )
      structured_outputs = tf.nest.pack_sequence_as(
          restored_function.structured_outputs,
          wrapped.outputs,
          expand_composites=True,
      )
      wrapped = wrapped.prune(wrapped.inputs, structured_outputs)
      return (wrapped, signature.inputs, wrapped.structured_outputs)
  
imports: from typing import Any, Dict, Iterable, Mapping, Tuple, Union
  import tensorflow
  from tensorflow_transform import annotators
  from tensorflow_transform import common_types
  from tensorflow_transform import graph_tools
  from tensorflow_transform import tf2_utils
  from tensorflow_transform import tf_utils
  from tensorflow_transform.py_func import pyfunc_helper
  from tensorflow_transform.saved import constants
  from tensorflow_transform.saved import saved_model_loader
  from tensorflow_transform.saved import saved_transform_io
  from tensorflow.python.eager import function
  from tensorflow.python.eager import wrap_function
  from tensorflow.python.framework import composite_tensor
  from tensorflow.python.ops import lookup_ops
  from tensorflow.python.util import object_identity
label_desc: Use image node_id 1 for calling a global function with example usage: _restore_from_v1_saved_model(restored_function, saved_model_dir) and returns: wrapped,  signature,  wrapped, restored_function,  signature,  restored_function