code: def _get_or_create_global_step_read(graph=None):
      """Gets or creates global step read tensor in graph.
  
      Args:
        graph: The graph in which to create the global step read tensor. If missing,
          use default graph.
  
      Returns:
        Global step read tensor if there is global_step_tensor else return None.
      """
      graph = graph or ops.get_default_graph()
      global_step_read_tensor = _get_global_step_read(graph)
      if global_step_read_tensor is not None:
          return global_step_read_tensor
      global_step_tensor = get_global_step(graph)
      if global_step_tensor is None:
          return None
      # add 'zero' so that it will create a copy of variable as Tensor.
      with graph.as_default() as g, g.name_scope(None):
          with g.name_scope(global_step_tensor.op.name + "/"):
              # must ensure that global_step is initialized before
              # this run. This is needed for example Estimator makes all model_fn build
              # under global_step_read_tensor dependency.
              if isinstance(global_step_tensor, variables.Variable):
                  global_step_value = cond.cond(
                      variable_v1.is_variable_initialized(
                          global_step_tensor
                      ),
                      global_step_tensor.read_value,
                      lambda: global_step_tensor.initial_value,
                  )
              else:
                  global_step_value = global_step_tensor
  
              global_step_read_tensor = global_step_value + 0
              ops.add_to_collection(
                  GLOBAL_STEP_READ_KEY, global_step_read_tensor
              )
      return _get_global_step_read(graph)
  
imports: from tensorflow.python.eager import context
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import graph_io
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.ops import cond
  from tensorflow.python.ops import init_ops
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.ops import state_ops
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.ops import variable_v1
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 7 for calling a global function with example usage: _get_or_create_global_step_read(graph) and returns: _get_global_step_read, global_step_read_tensor, None