code: def test_stale_asset_collections_are_cleaned(self):
      vocabulary_file = os.path.join(
          tempfile.mkdtemp(dir=self.get_temp_dir()), "asset"
      )
      file_io.write_string_to_file(vocabulary_file, "foo bar baz")
  
      input_specs = {"input": tf.TensorSpec([], dtype=tf.string)}
  
      def preprocessing_fn(inputs):
          initializer = tf.lookup.TextFileInitializer(
              vocabulary_file,
              key_dtype=tf.string,
              key_index=tf.lookup.TextFileIndex.WHOLE_LINE,
              value_dtype=tf.int64,
              value_index=tf.lookup.TextFileIndex.LINE_NUMBER,
          )
          table = tf.lookup.StaticHashTable(
              initializer, default_value=12
          )
          return {"output": table.lookup(inputs["input"])}
  
      export_path = _create_test_saved_model(
          False,
          input_specs,
          preprocessing_fn,
          base_dir=self.get_temp_dir(),
      )
  
      # Load it and save it again repeatedly, verifying that the asset collections
      # remain valid.
      for it in [1, 2, 3]:
          input_string = tf.constant("dog")
          inputs = {"input": input_string}
          saved_model_loader = saved_transform_io_v2.SavedModelLoader(
              export_path
          )
          outputs = saved_model_loader.apply_transform_model(inputs)
          self.assertEqual(12, outputs["output"])
  
          new_export_path = os.path.join(
              tempfile.mkdtemp(dir=self.get_temp_dir()),
              "export_" + str(it),
          )
          tf.saved_model.save(
              saved_model_loader._imported, new_export_path
          )
          shutil.rmtree(export_path)
          export_path = new_export_path
  
imports: import os
  import shutil
  import tempfile
  import numpy
  import tensorflow
  from tensorflow_transform import graph_context
  from tensorflow_transform import impl_helper
  from tensorflow_transform import tf_utils
  from tensorflow_transform import test_case
  from tensorflow_transform.py_func.api import apply_pyfunc
  from tensorflow_transform.saved import constants
  from tensorflow_transform.saved import saved_transform_io
  from tensorflow_transform.saved import saved_transform_io_v2
  from tensorflow.core.protobuf import meta_graph_pb2
  from tensorflow.python.lib.io import file_io
  from tensorflow.python.ops import script_ops
label_desc: Use image node_id 16 for calling the SavedTransformIOV2Test obj's underlying member method code with example usage: obj.test_stale_asset_collections_are_cleaned() and returns: dict