code: def training_parameter_schedule(
      schedule, unit=UnitType.minibatch, epoch_size=None
  ):
      """
      Deprecated:: 2.2
  
      Create a training parameter schedule containing either per-sample (default)
      or per-minibatch values.
  
      Examples:
          >>> # Use a fixed value 0.01 for all samples
          >>> s = training_parameter_schedule(0.01)
          >>> s[0], s[1]
          (0.01, 0.01)
  
          >>> # Use 0.01 for the first 1000 samples, then 0.001 for the remaining ones
          >>> s = training_parameter_schedule([0.01, 0.001], epoch_size=1000)
          >>> s[0], s[1], s[1000], s[1001]
          (0.01, 0.01, 0.001, 0.001)
  
          >>> # Use 0.1 for the first 12 epochs, then 0.01 for the next 15,
          >>> # followed by 0.001 for the remaining ones, with a 100 samples in an epoch
          >>> s = training_parameter_schedule([(12, 0.1), (15, 0.01), (1, 0.001)], epoch_size=100)
          >>> s[0], s[1199], s[1200], s[2699], s[2700], s[5000]
          (0.1, 0.1, 0.01, 0.01, 0.001, 0.001)
  
      Args:
          schedule (float or list): if float, is the parameter schedule to be used
           for all samples. In case of list, the elements are used as the
           values for ``epoch_size`` samples. If list contains pair, the second element is
           used as a value for (``epoch_size`` x first element) samples
          unit (:class:`UnitType`): one of two
            * ``sample``: the returned schedule contains per-sample values
            * ``minibatch``: the returned schedule contains per-minibatch values.
  
              deprecated:: 2.2
                  Use minibatch_size parameter to specify the reference minbiatch size.
          epoch_size (optional, int): number of samples as a scheduling unit.
           Parameters in the schedule change their values every ``epoch_size``
           samples. If no ``epoch_size`` is provided, this parameter is substituted
           by the size of the full data sweep, in which case the scheduling unit is
           the entire data sweep (as indicated by the MinibatchSource) and parameters
           change their values on the sweep-by-sweep basis specified by the
           ``schedule``.
  
      Returns:
          training parameter schedule
  
      See also:
          :func:`learning_parameter_schedule`
      """
  
      if unit == UnitType.sample:
          ref_minibatch_size = 1
      else:  # unit == UnitType.minibatch
          ref_minibatch_size = (
              cntk_py.training_double_parameter_schedule.ignored_minibatch_size
          )
  
      if isinstance(
          schedule, cntk_py.training_double_parameter_schedule
      ):
          schedule.is_minibatch_size_explicitly_specified = True  # legacy learning parameter always have the specification
          return schedule
  
      if isinstance(schedule, (int, float)):
          if epoch_size is not None:
              warnings.warn(
                  "When providing the schedule as a number, epoch_size is ignored",
                  RuntimeWarning,
              )
          if UnitType(unit):
              schedule = cntk_py.training_double_parameter_schedule(
                  *[schedule, ref_minibatch_size]
              )
              schedule.is_minibatch_size_explicitly_specified = True  # legacy learning parameter always have the specification
              return schedule
  
      epoch_size = (
          epoch_size
          if epoch_size is not None
          else cntk_py.training_double_parameter_schedule.full_data_sweep
      )
      if isinstance(schedule, list) and UnitType(unit):
          schedule = _prepare_training_parameter_list(schedule)
          args = [schedule, epoch_size, ref_minibatch_size]
          schedule = cntk_py.training_double_parameter_schedule(*args)
          schedule.is_minibatch_size_explicitly_specified = True  # legacy learning parameter always have the specification
          return schedule
  
      raise ValueError(
          "schedule must be either a float or a list, not %s"
          % type(schedule)
      )
  
imports: from enum import Enum, unique
  import warnings
  import numpy
  import cntk.internal.utils
  from ..None import cntk_py, NDArrayView, asarray
  from cntk.internal import typemap
  from ..internal.swig_helper import map_if_possible
label_desc: Use image node_id 6 for calling a global function with example usage: training_parameter_schedule(schedule, unit, epoch_size) and returns: schedule, schedule, schedule