code: def _create_graph_with_tf2_saved_model_with_table():
      def export_saved_model_v2():
          root = tf.Module()
  
          @tf.function(
              input_signature=[tf.TensorSpec(shape=[], dtype=tf.string)]
          )
          def lookup_fn(x):
              table_keys = ["cat", "dog", "giraffe"]
              root.initializer = tf.lookup.KeyValueTensorInitializer(
                  keys=table_keys,
                  values=tf.cast(tf.range(len(table_keys)), tf.int64),
                  key_dtype=tf.string,
                  value_dtype=tf.int64,
              )
              root.table = tf.lookup.StaticHashTable(
                  root.initializer, default_value=-1
              )
              return root.table.lookup(x)
  
          result = os.path.join(tempfile.mkdtemp(), "export_path")
          root.lookup_fn = lookup_fn
          tf.compat.v2.saved_model.save(root, result)
          return result
  
      module_path = export_saved_model_v2()
  
      def bar(x):
          imported = tf.compat.v2.saved_model.load(module_path)
          return imported.lookup_fn(x)
  
      x = tf.compat.v1.placeholder(tf.string)
      a = bar(x)
      return {"x": x, "a": a}
  
imports: import abc
  import os
  import tempfile
  import tensorflow
  from tensorflow_transform import graph_tools
  from tensorflow_transform import test_case
  from tfx_bsl.types import tfx_namedtuple
  from tensorflow.python.ops import control_flow_ops
label_desc: Use image node_id 4 for calling a global function with example usage: _create_graph_with_tf2_saved_model_with_table() and returns: dict, result, imported, root