code: def _scheduled_value(value, schedule, step, name, summary=False):
      """Create a tensor whose value depends on global step.
  
      Args:
        value: The value to adapt.
        schedule: Dictionary. Expects 'steps' and 'vals'.
        step: The global_step to find to.
        name: Name of the value.
        summary: Boolean, whether to add a summary for the scheduled value.
  
      Returns:
        tf.Tensor.
      """
      with tf.name_scope("schedule_" + name):
          if len(schedule["steps"]) + 1 != len(schedule["vals"]):
              raise ValueError(
                  "Schedule expects one more value than steps."
              )
          steps = [int(s) for s in schedule["steps"]]
          steps = tf.stack(steps + [step + 1])
          idx = tf.where(step < steps)[0, 0]
          value = value * tf.convert_to_tensor(schedule["vals"])[idx]
      if summary:
          tf.summary.scalar(name, value)
      return value
  
imports: import collections
  import glob
  import itertools
  from compare_gan.gans import loss_lib
  import tensorflow.compat.v1
  import tensorflow_datasets
  from hific import archs
  from hific import helpers
  from hific.helpers import ModelMode
  from hific.helpers import ModelType
  from hific.helpers import TFDSArguments
label_desc: Use image node_id 2 for calling a global function with example usage: _scheduled_value(value, schedule, step, name, summary) and returns: value