code: def test_momentum_schedule():
      m = 2500
      ms = C.momentum_as_time_constant_schedule([m])
      # all the timeconstant schedule is for per sample
      assert ms.minibatch_size == 1
      assert ms[0] == np.exp(-1.0 / np.asarray(m))
  
      ms = C.momentum_as_time_constant_schedule(m)
      assert ms.minibatch_size == 1
      assert ms[0] == np.exp(-1.0 / np.asarray(m))
  
      mlist = [980, 520]
      msl = C.momentum_as_time_constant_schedule(mlist)
      assert ms.minibatch_size == 1
      expected = np.exp(-1.0 / np.asarray(mlist))
      assert all(mi == ei for mi, ei in zip(msl, expected))
  
imports: from __future__ import division, print_function
  import numpy
  import cntk
  from cntk import parameter
  import pytest
  import sys
  import itertools
  from cntk.logging import ProgressPrinter
  from cntk.learners import sgd, learning_rate_schedule, learning_parameter_schedule, UnitType, universal
  from cntk.layers import Dense, Sequential
label_desc: Use image node_id 4 for calling a global function with example usage: test_momentum_schedule() without return types