code: def objects_ids_and_slot_variables_and_paths(
      graph_view, skip_slot_variables=False
  ):
      """Traverse the object graph and list all accessible objects.
  
      Looks for `Trackable` objects which are dependencies of
      `root_trackable`. Includes slot variables only if the variable they are
      slotting for and the optimizer are dependencies of `root_trackable`
      (i.e. if they would be saved with a checkpoint).
  
      Args:
        graph_view: A GraphView object.
        skip_slot_variables: If True does not return trackables for slot variable.
          Default False.
  
      Returns:
        A tuple of (trackable objects, paths from root for each object,
                    object -> node id, slot variables, object_names)
      """
      (
          trackable_objects,
          node_paths,
      ) = graph_view.breadth_first_traversal()
      object_names = object_identity.ObjectIdentityDictionary()
      for obj, path in node_paths.items():
          object_names[obj] = trackable_utils.object_path_to_string(
              path
          )
      node_ids = object_identity.ObjectIdentityDictionary()
      for node_id, node in enumerate(trackable_objects):
          node_ids[node] = node_id
      if skip_slot_variables:
          slot_variables = object_identity.ObjectIdentityDictionary()
      else:
          slot_variables = serialize_slot_variables(
              trackable_objects=trackable_objects,
              node_ids=node_ids,
              object_names=object_names,
          )
      return (
          trackable_objects,
          node_paths,
          node_ids,
          slot_variables,
          object_names,
      )
  
file_path: tensorflow/tensorflow/python/checkpoint/util.py
imports: from tensorflow.core.protobuf import trackable_object_graph_pb2
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.trackable import trackable_utils
  from tensorflow.python.util import object_identity
label_desc: Use image node_id 5 for calling a global function with example usage: objects_ids_and_slot_variables_and_paths(graph_view, skip_slot_variables) and returns: trackable_objects,  node_paths,  node_ids,  slot_variables,  object_names