code: def _infer_learning_parameter_schedule(
      number_or_schedule,
      ref_minibatch_size,
      epoch_size,
      use_mean_gradient=None,
  ):
      # the input is a number, create a new training parameter
      if isinstance(number_or_schedule, (int, float)) or (
          isinstance(number_or_schedule, list)
          and all(
              isinstance(r, (int, float, tuple))
              for r in number_or_schedule
          )
      ):
          # default is per minibatch if the reference minibatch size is not specified.
          ref_minibatch_size = (
              0 if ref_minibatch_size is None else ref_minibatch_size
          )
          schedule = learning_parameter_schedule(
              number_or_schedule, ref_minibatch_size, epoch_size
          )
          schedule.is_minibatch_size_explicitly_specified = (
              ref_minibatch_size is not None
          )
          return schedule
      elif isinstance(
          number_or_schedule, cntk_py.training_double_parameter_schedule
      ):
          if (
              not number_or_schedule.is_minibatch_size_explicitly_specified
              and ref_minibatch_size is not None
          ):
              # If the schedule minibatch size is not explicitly specified, the learner's specification will take over
              number_or_schedule.minibatch_size = ref_minibatch_size
          # for backward compatibility: use_mean_gradient = True and lr.unit = UnitType.sample
          # this combination was there to avoid the double-scaling of gradients when the gradients are already mean gradients
          if (
              use_mean_gradient
              and number_or_schedule.minibatch_size == 1
          ):
              # override the learning rate's minibatch_size to IGNORE
              number_or_schedule.minibatch_size = IGNORE
              Warning(
                  "use_mean_gradient=True and learning_rate_schedule.unit=UnitType.sample is a deprecated combination. "
                  "Please use the new learner APIs: see https://www.cntk.ai/pythondocs/cntk.learners.html for details."
              )
          return number_or_schedule
      else:
          raise ValueError(
              "training parameter schedule type (%s) not supported. "
              "training parameter schedule must be a training schedule "
              % type(number_or_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 14 for calling a global function with example usage: _infer_learning_parameter_schedule(number_or_schedule, ref_minibatch_size, epoch_size, use_mean_gradient) and returns: schedule, number_or_schedule