code: def test_lr(
      self, min_lr, max_lr, decay_rate, cycle_step_size, decay_step_size
  ):
      config_dict = {
          "train_batch_size": 2,
          "steps_per_print": 1,
          "optimizer": {
              "type": "Adam",
              "params": {"lr": 0.00015},
          },
          "scheduler": {
              "type": ONE_CYCLE,
              "params": {
                  CYCLE_MIN_LR: min_lr,
                  CYCLE_MAX_LR: max_lr,
                  DECAY_LR_RATE: decay_rate,
                  CYCLE_FIRST_STEP_SIZE: cycle_step_size,
                  DECAY_STEP_SIZE: decay_step_size,
              },
          },
          "gradient_clipping": 1.0,
      }
      hidden_dim = 10
  
      model = SimpleModel(hidden_dim, empty_grad=False)
      model, _, _, lr_scheduler = deepspeed.initialize(
          config=config_dict,
          model=model,
          model_parameters=model.parameters(),
      )
      data_loader = random_dataloader(
          model=model,
          total_samples=max(50, cycle_step_size * 3),
          hidden_dim=hidden_dim,
          device=model.device,
          dtype=torch.float,
      )
  
      step_lrs = []
      for _, batch in enumerate(data_loader):
          step_lrs.extend(lr_scheduler.get_lr())
          loss = model(batch[0], batch[1])
          model.backward(loss)
          model.step()
  
      # Verify starting lr
      assert step_lrs[0] == min_lr
  
      # Verify peak lr
      assert step_lrs[cycle_step_size] == max_lr
  
      # Verify increasing phase
      _verify_continuous_increase(step_lrs[:cycle_step_size])
  
      # Verify decreasing phase
      _verify_continuous_decrease(
          step_lrs[cycle_step_size : (cycle_step_size * 2)]
      )
  
      # Verify decay phase
      if decay_rate > 0:
          _verify_continuous_decrease(step_lrs[(cycle_step_size * 2) :])
  
imports: import torch
  import deepspeed
  import pytest
  from unit.common import DistributedTest
  from unit.simple_model import SimpleModel, random_dataloader
  from deepspeed.runtime.lr_schedules import LR_RANGE_TEST, LR_RANGE_TEST_MIN_LR, LR_RANGE_TEST_STEP_RATE, LR_RANGE_TEST_STEP_SIZE, LR_RANGE_TEST_STAIRCASE
  from deepspeed.runtime.lr_schedules import WARMUP_LR, WARMUP_MIN_LR, WARMUP_MAX_LR, WARMUP_NUM_STEPS, WARMUP_TYPE, WARMUP_LOG_RATE, WARMUP_LINEAR_RATE
  from deepspeed.runtime.lr_schedules import ONE_CYCLE, CYCLE_MIN_LR, CYCLE_MAX_LR, CYCLE_FIRST_STEP_SIZE, DECAY_LR_RATE, DECAY_STEP_SIZE
  from deepspeed.runtime.lr_schedules import CYCLE_MIN_MOM, CYCLE_MAX_MOM, DECAY_MOM_RATE
  from deepspeed.runtime.lr_schedules import WARMUP_DECAY_LR, TOTAL_NUM_STEPS
  from deepspeed.runtime.lr_schedules import WARMUP_COSINE_LR, WARMUP_MIN_RATIO, COS_MIN_RATIO
label_desc: Use image node_id 1 for calling the TestOneCycle obj's underlying member method code with example usage: obj.test_lr(min_lr, max_lr, decay_rate, cycle_step_size, decay_step_size) without return types