code: def register_revived_type(identifier, predicate, versions):
      """Register a type for revived objects.
  
      Args:
        identifier: A unique string identifying this class of objects.
        predicate: A Boolean predicate for this registration. Takes a
          trackable object as an argument. If True, `type_registration` may be
          used to save and restore the object.
        versions: A list of `VersionedTypeRegistration` objects.
      """
      # Keep registrations in order of version. We always use the highest matching
      # version (respecting the min consumer version and bad consumers).
      versions.sort(key=lambda reg: reg.version, reverse=True)
      if not versions:
          raise AssertionError(
              "Need at least one version of a registered type."
          )
      version_numbers = set()
      for registration in versions:
          # Copy over the identifier for use in generating protos
          registration.identifier = identifier
          if registration.version in version_numbers:
              raise AssertionError(
                  f"Got multiple registrations with version {registration.version} for "
                  f"type {identifier}."
              )
          version_numbers.add(registration.version)
  
      _REVIVED_TYPE_REGISTRY[identifier] = (predicate, versions)
      _TYPE_IDENTIFIERS.append(identifier)
  
file_path: tensorflow-upstream/tensorflow/python/saved_model/revived_types.py
imports: import operator
  from tensorflow.core.framework import versions_pb2
  from tensorflow.core.protobuf import saved_object_graph_pb2
  from tensorflow.python.trackable import data_structures
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 1 for calling a global function with example usage: register_revived_type(identifier, predicate, versions) without return types