code: def test_fixed_scheduler(start_lr, warmup_iteration, *args, **kwargs):
      opts = get_config()
      setattr(opts, "scheduler.max_iterations", 100000)
      setattr(opts, "scheduler.name", "fixed")
  
      num_iterations = getattr(opts, "scheduler.max_iterations", 100000)
      num_batches = DATASET_SIZE // BATCH_SIZE
      num_epochs = num_iterations // num_batches
  
      # Test for iteration-based samplers
      setattr(opts, "scheduler.is_iteration_based", True)
      setattr(opts, "scheduler.warmup_iterations", warmup_iteration)
      setattr(opts, "scheduler.fixed.lr", start_lr)
      scheduler = build_scheduler(opts)
      lr = run_test(
          scheduler=scheduler,
          num_epochs=num_epochs,
          num_batches=num_batches,
      )
      np.testing.assert_allclose(start_lr, lr, atol=LR_TOLERANCE)
  
      # Test for epoch-based samplers
      setattr(opts, "scheduler.is_iteration_based", False)
      setattr(opts, "scheduler.max_epochs", num_epochs)
      setattr(opts, "scheduler.adjust_period_for_epochs", True)
      setattr(opts, "scheduler.warmup_iterations", warmup_iteration)
      setattr(opts, "scheduler.fixed.lr", start_lr)
      scheduler = build_scheduler(opts)
      lr = run_test(
          scheduler=scheduler,
          num_epochs=num_epochs,
          num_batches=num_batches,
      )
      np.testing.assert_allclose(start_lr, lr, atol=LR_TOLERANCE)
  
file_path: ml-cvnets/tests/test_scheduler.py
imports: import random
  import sys
  from typing import List, Optional, Union
  import numpy
  import pytest
  from optim.scheduler import build_scheduler
  from tests.configs import get_config
label_desc: Use image node_id 4 for calling a global function with example usage: test_fixed_scheduler(start_lr, warmup_iteration) without return types