code: def test_single_method():
      N = 1000
      constant = LRScheduler(
          "constant", base_lr=0, target_lr=1, niters=N
      )
      linear = LRScheduler("linear", base_lr=1, target_lr=2, niters=N)
      cosine = LRScheduler("cosine", base_lr=3, target_lr=1, niters=N)
      poly = LRScheduler(
          "poly", base_lr=1, target_lr=0, niters=N, power=2
      )
      step = LRScheduler(
          "step",
          base_lr=1,
          target_lr=0,
          niters=N,
          step_iter=[100, 500],
          step_factor=0.1,
      )
      step2 = LRScheduler(
          "step",
          base_lr=1,
          target_lr=0,
          nepochs=2,
          iters_per_epoch=N / 2,
          step_iter=[100, 500],
          step_factor=0.1,
      )
      step3 = LRScheduler(
          "step",
          base_lr=1,
          target_lr=0,
          nepochs=100,
          iters_per_epoch=N / 100,
          step_epoch=[10, 50],
          step_factor=0.1,
      )
  
      # Test numerical value
      for i in range(N):
          compare(constant, i, 0)
  
          expect_linear = 2 + (1 - 2) * (1 - i / (N - 1))
          compare(linear, i, expect_linear)
  
          expect_cosine = 1 + (3 - 1) * (
              (1 + cos(pi * i / (N - 1))) / 2
          )
          compare(cosine, i, expect_cosine)
  
          expect_poly = 0 + (1 - 0) * (pow(1 - i / (N - 1), 2))
          compare(poly, i, expect_poly)
  
          if i < 100:
              expect_step = 1
          elif i < 500:
              expect_step = 0.1
          else:
              expect_step = 0.01
          compare(step, i, expect_step)
          compare(step2, i, expect_step)
          compare(step3, i, expect_step)
  
      # Test out-of-range updates
      for i in range(10):
          constant.update(i - 3)
          linear.update(i - 3)
          cosine.update(i - 3)
          poly.update(i - 3)
  
file_path: gluon-cv/tests/unittests/test_lr_scheduler.py
imports: from __future__ import print_function
  from __future__ import division
  import os.path
  import mxnet
  import numpy
  import gluoncv
  from mxnet import autograd, gluon
  from math import pi, cos
  from gluoncv.utils import LRScheduler, LRSequential
label_desc: Use image node_id 3 for calling a global function with example usage: test_single_method() without return types