code: def test_composed_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
      )
      # components with niters=0 will be ignored
      null_cosine = LRScheduler(
          "cosine", base_lr=3, target_lr=1, niters=0
      )
      null_poly = LRScheduler(
          "cosine", base_lr=3, target_lr=1, niters=0
      )
      step = LRScheduler(
          "step",
          base_lr=1,
          target_lr=0,
          niters=N,
          step_iter=[100, 500],
          step_factor=0.1,
      )
      arr = LRSequential(
          [constant, null_cosine, linear, cosine, null_poly, poly, step]
      )
      # constant
      for i in range(N):
          compare(arr, i, 0)
      # linear
      for i in range(N, 2 * N):
          expect_linear = 2 + (1 - 2) * (1 - (i - N) / (N - 1))
          compare(arr, i, expect_linear)
      # cosine
      for i in range(2 * N, 3 * N):
          expect_cosine = 1 + (3 - 1) * (
              (1 + cos(pi * (i - 2 * N) / (N - 1))) / 2
          )
          compare(arr, i, expect_cosine)
      # poly
      for i in range(3 * N, 4 * N):
          expect_poly = 0 + (1 - 0) * (
              pow(1 - (i - 3 * N) / (N - 1), 2)
          )
          compare(arr, i, expect_poly)
      for i in range(4 * N, 5 * N):
          if i - 4 * N < 100:
              expect_step = 1
          elif i - 4 * N < 500:
              expect_step = 0.1
          else:
              expect_step = 0.01
          compare(arr, i, expect_step)
      # out-of-bound index
      compare(arr, 10 * N, 0.01)
      compare(arr, -1, 0)
  
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 4 for calling a global function with example usage: test_composed_method() without return types