code: def test_create_lr_scheduler_with_warmup_with_real_model(
      dummy_model_factory,
  ):
      model = dummy_model_factory(
          with_grads=False, with_frozen_layer=False
      )
      init_lr = 0.01
      optimizer = torch.optim.SGD(model.parameters(), lr=init_lr)
      scaled_lr = 0.02
      warmup_duration = 5
      step_size = 2
      gamma = 0.97
  
      output_simulated_values = [None] * 50
  
      create_lr_scheduler_with_warmup(
          torch.optim.lr_scheduler.StepLR(
              optimizer, step_size=step_size, gamma=gamma
          ),
          warmup_start_value=0.0,
          warmup_end_value=scaled_lr,
          warmup_duration=warmup_duration,
          output_simulated_values=output_simulated_values,
      )
  
      assert output_simulated_values[0] == [0, 0.0]
      assert output_simulated_values[warmup_duration - 1] == [
          warmup_duration - 1,
          scaled_lr,
      ]
      assert output_simulated_values[warmup_duration] == [
          warmup_duration,
          init_lr,
      ]
      v = [warmup_duration + step_size, init_lr * gamma]
      assert output_simulated_values[warmup_duration + step_size] == v
  
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 20 for calling a global function with example usage: test_create_lr_scheduler_with_warmup_with_real_model(dummy_model_factory) without return types