code: def test_lookup_table_compatibility(self):
      saveable_compat.force_checkpoint_conversion(False)
  
      table_module = generate_checkpoint.TableModule()
      ckpt = checkpoint.Checkpoint(table_module)
      checkpoint_directory = self.get_temp_dir()
      checkpoint_path = os.path.join(checkpoint_directory, "ckpt")
      ckpt.write(checkpoint_path)
  
      # Ensure that the checkpoint metadata and keys are the same.
      legacy_metadata = checkpoint.object_metadata(
          _LEGACY_TABLE_CHECKPOINT_PATH
      )
      metadata = checkpoint.object_metadata(checkpoint_path)
  
      def _get_table_node(object_metadata):
          for child in object_metadata.nodes[0].children:
              if child.local_name == "lookup_table":
                  return object_metadata.nodes[child.node_id]
  
      table_proto = _get_table_node(metadata)
      legacy_table_proto = _get_table_node(legacy_metadata)
      self.assertAllEqual(
          [
              table_proto.attributes[0].name,
              table_proto.attributes[0].checkpoint_key,
          ],
          [
              legacy_table_proto.attributes[0].name,
              legacy_table_proto.attributes[0].checkpoint_key,
          ],
      )
      legacy_reader = checkpoint_utils.load_checkpoint(
          _LEGACY_TABLE_CHECKPOINT_PATH
      )
      reader = checkpoint_utils.load_checkpoint(checkpoint_path)
      self.assertEqual(
          legacy_reader.get_variable_to_shape_map().keys(),
          reader.get_variable_to_shape_map().keys(),
      )
  
      # Ensure that previous checkpoint can be loaded into current table.
      ckpt.read(_LEGACY_TABLE_CHECKPOINT_PATH).assert_consumed()
  
file_path: tensorflow/tensorflow/python/checkpoint/saveable_compat_test.py
imports: import os
  from tensorflow.python.checkpoint import checkpoint
  from tensorflow.python.checkpoint import saveable_compat
  from tensorflow.python.checkpoint.testdata import generate_checkpoint
  from tensorflow.python.eager import test
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.trackable import base
  from tensorflow.python.training import checkpoint_utils
  from tensorflow.python.training.saving import saveable_object
label_desc: Use image node_id 1 for calling the SaveableCompatTest obj's underlying member method code with example usage: obj.test_lookup_table_compatibility() and returns: object_metadata