code: def get_global_generator():
      """Retrieves the global generator.
  
      This function will create the global generator the first time it is called,
      and the generator will be placed at the default device at that time, so one
      needs to be careful when this function is first called. Using a generator
      placed on a less-ideal device will incur performance regression.
  
      Returns:
        The global `tf.random.Generator` object.
      """
      global global_generator
      if global_generator is None:
          if config.is_op_determinism_enabled():
              raise RuntimeError(
                  '"get_global_generator" cannot be called if '  # pylint: disable=g-doc-exception
                  "determinism is enabled, unless "
                  '"set_global_generator" has already been called. '
                  'Please call "set_global_generator" first.'
              )
          with ops.init_scope():
              global_generator = (
                  Generator.from_non_deterministic_state()
              )
      return global_generator
  
imports: from tensorflow.python.distribute import distribute_lib
  from tensorflow.python.distribute import sharded_variable
  from tensorflow.python.distribute import values_util
  from tensorflow.python.eager import context
  from tensorflow.python.framework import config
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import array_ops_stack
  from tensorflow.python.ops import gen_stateful_random_ops
  from tensorflow.python.ops import gen_stateless_random_ops_v2
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import random_ops_util
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.ops import stateless_random_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.trackable import autotrackable
  from tensorflow.python.util import nest
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 12 for calling a global function with example usage: get_global_generator() and returns: global_generator