code: def get_global_step_var():
      """
      Returns:
          tf.Tensor: the global_step variable in the current graph. Create if doesn't exist.
      """
      scope = tfv1.VariableScope(reuse=False, name="")  # the root vs
      with tfv1.variable_scope(scope):
          var = tfv1.train.get_or_create_global_step()
      return var
  
file_path: tensorpack/tensorpack/tfutils/common.py
imports: import tensorflow
  from ..compat import tfv1
  from ..utils.argtools import graph_memoized
  from .collect_env import collect_env_info
label_desc: Use image node_id 2 for calling a global function with example usage: get_global_step_var() and returns: var