code: def test_construct_and_lookup_table(
      self, asset_path_input_fn, function_handler
  ):
      vocab_filename = os.path.join(self.get_temp_dir(), "test.txt")
      vocab_data = [("a", "0"), ("b", "1"), ("c", "1"), ("d", "2"), ()]
      encoded_vocab = "\n".join(
          ["\t".join(pair) for pair in vocab_data]
      )
      with tf.io.gfile.GFile(vocab_filename, "w") as writer:
          writer.write(encoded_vocab)
  
      @function_handler(
          input_signature=[tf.TensorSpec(shape=[None], dtype=tf.string)]
      )
      def foo(input_tensor):
          (
              output_tensor,
              unused_table_size,
          ) = tf_utils.construct_and_lookup_table(
              _construct_table,
              asset_path_input_fn(vocab_filename),
              input_tensor,
          )
          return output_tensor
  
      expected_data = [0, 1, 1, 2, -1]
      output_tensor = foo(["a", "b", "c", "d", "e"])
      self.assertAllEqual(output_tensor, expected_data)
  
imports: import os
  import numpy
  from packaging import version
  import tensorflow
  from tensorflow_transform import analyzers
  from tensorflow_transform import annotators
  from tensorflow_transform import tf_utils
  from tensorflow_transform import test_case
  from tensorflow.python.framework import composite_tensor
label_desc: Use image node_id 6 for calling the VocabTFUtilsTest obj's underlying member method code with example usage: obj.test_construct_and_lookup_table(asset_path_input_fn, function_handler) and returns: output_tensor