code: def global_mode():
      """Returns the Tensor of global mode.
  
      This is a placeholder with default value of
      :tf_main:`tf.estimator.ModeKeys.TRAIN <estimator/ModeKeys>`.
  
      Example:
  
          .. code-block:: python
  
              mode = session.run(global_mode())
              # mode == tf.estimator.ModeKeys.TRAIN
  
              mode = session.run(
                  global_mode(),
                  feed_dict={tf.global_mode(): tf.estimator.ModeKeys.PREDICT})
              # mode == tf.estimator.ModeKeys.PREDICT
      """
      mode = tf.get_collection_ref(_GLOBAL_MODE_KEY)
      if len(mode) < 1:
          # mode_tensor = tf.placeholder(tf.string, name="global_mode")
          mode_tensor = tf.placeholder_with_default(
              input=tf.estimator.ModeKeys.TRAIN,
              shape=(),
              name="global_mode",
          )
          # mode_tensor = tf.constant(
          #    value=tf.estimator.ModeKeys.TRAIN,
          #    dtype=tf.string,
          #    name="global_mode")
          mode.append(mode_tensor)
      return mode[0]
  
imports: import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: global_mode() and returns: mode