code: def test_schedule(backend_default):
      """
      Test constant rate, fixed step and various modes of programmable steps.
      """
      lr_init = 0.1
  
      # default scheduler has a constant learning rate
      sch = Schedule()
      for epoch in range(10):
          lr = sch.get_learning_rate(learning_rate=lr_init, epoch=epoch)
          assert lr == lr_init
  
      # test a uniform step schedule
      step_config = 2
      change = 0.5
      sch = Schedule(step_config=step_config, change=change)
      for epoch in range(10):
          lr = sch.get_learning_rate(learning_rate=lr_init, epoch=epoch)
          # test a repeated call for the same epoch
          lr2 = sch.get_learning_rate(
              learning_rate=lr_init, epoch=epoch
          )
          # print epoch, lr, lr2
          assert allclose_with_out(
              lr, lr_init * change ** (np.floor(epoch // step_config))
          )
          assert allclose_with_out(
              lr2, lr_init * change ** (np.floor(epoch // step_config))
          )
  
      # test a list step schedule
      sch = Schedule(step_config=[2, 3], change=0.1)
      assert allclose_with_out(
          0.1, sch.get_learning_rate(learning_rate=0.1, epoch=0)
      )
      assert allclose_with_out(
          0.1, sch.get_learning_rate(learning_rate=0.1, epoch=1)
      )
      assert allclose_with_out(
          0.01, sch.get_learning_rate(learning_rate=0.1, epoch=2)
      )
      # test a repeated call for the same epoch
      assert allclose_with_out(
          0.01, sch.get_learning_rate(learning_rate=0.1, epoch=2)
      )
      assert allclose_with_out(
          0.001, sch.get_learning_rate(learning_rate=0.1, epoch=3)
      )
      assert allclose_with_out(
          0.001, sch.get_learning_rate(learning_rate=0.1, epoch=4)
      )
  
file_path: neon/tests/test_schedule.py
imports: import numpy
  from neon.optimizers import Schedule, ExpSchedule, PowerSchedule, StepSchedule, ShiftSchedule
  from utils import allclose_with_out
label_desc: Use image node_id 1 for calling a global function with example usage: test_schedule(backend_default) without return types