code: def test_create_lr_scheduler_with_warmup(
      lr_scheduler_name,
      warmup_start_value,
      warmup_end_value,
      warmup_duration,
      warmup_end_next_value,
  ):
      t1 = torch.zeros([1], requires_grad=True)
  
      if lr_scheduler_name == "ExponentialLR":
          optimizer = torch.optim.SGD([t1], lr=0.2)
          lr_scheduler = torch.optim.lr_scheduler.ExponentialLR(
              optimizer=optimizer, gamma=0.98
          )
      elif lr_scheduler_name == "LinearCyclicalScheduler":
          optimizer = torch.optim.SGD([t1], lr=0.0)
          lr_scheduler = LinearCyclicalScheduler(
              optimizer=optimizer,
              param_name="lr",
              start_value=0.8,
              end_value=0.0,
              cycle_size=10,
          )
      else:
          raise ValueError(f"Unknown name: {lr_scheduler_name}")
  
      num_iterations = 10
      max_epochs = 20
  
      if warmup_end_value is None:
          expected_warmup_end_value = optimizer.param_groups[0]["lr"]
      else:
          expected_warmup_end_value = warmup_end_value
  
      simulated_values = [None] * (num_iterations * max_epochs)
      scheduler = create_lr_scheduler_with_warmup(
          lr_scheduler,
          warmup_start_value=warmup_start_value,
          warmup_end_value=warmup_end_value,
          warmup_duration=warmup_duration,
          output_simulated_values=simulated_values,
      )
  
      state_dict = scheduler.state_dict()
      trainer = Engine(lambda engine, batch: None)
  
      trainer.add_event_handler(Events.ITERATION_STARTED, scheduler)
  
      @trainer.on(Events.ITERATION_STARTED)
      def save_lr(engine):
          lrs.append(optimizer.param_groups[0]["lr"])
  
      data = [0] * num_iterations
  
      for _ in range(2):
          lrs = []
          trainer.run(data, max_epochs=max_epochs)
  
          assert lrs == pytest.approx([v for _, v in simulated_values])
  
          assert lrs[0] == pytest.approx(
              warmup_start_value
          ), f"lrs={lrs[: warmup_duration + num_iterations]}"
          assert lrs[warmup_duration - 1] == pytest.approx(
              expected_warmup_end_value
          ), f"lrs={lrs[: warmup_duration + num_iterations]}"
          assert lrs[warmup_duration] == pytest.approx(
              warmup_end_next_value
          ), f"lrs={lrs[: warmup_duration + num_iterations]}"
          scheduler.load_state_dict(state_dict)
  
imports: from unittest.mock import MagicMock, patch
  import numpy
  import pytest
  import torch
  from torch.optim.lr_scheduler import CosineAnnealingWarmRestarts, ExponentialLR, StepLR
  from ignite.engine import Engine, Events
  from ignite.handlers.param_scheduler import ConcatScheduler, CosineAnnealingScheduler, create_lr_scheduler_with_warmup, LinearCyclicalScheduler, LRScheduler, ParamGroupScheduler, ParamScheduler, PiecewiseLinear, ReduceLROnPlateauScheduler
  from tests.ignite.contrib.handlers import MockFP16DeepSpeedZeroOptimizer
label_desc: Use image node_id 18 for calling a global function with example usage: test_create_lr_scheduler_with_warmup(lr_scheduler_name, warmup_start_value, warmup_end_value, warmup_duration, warmup_end_next_value) without return types