code: def test_scheduler_with_mixed_types(self):
      config = self._get_valid_mixed_config()
      scheduler_0 = build_param_scheduler(config["schedulers"][0])
      scheduler_1 = build_param_scheduler(config["schedulers"][1])
  
      # Check scaled
      config["interval_scaling"] = ["rescaled", "rescaled"]
      scheduler = CompositeParamScheduler.from_config(config)
      scaled_schedule = [
          round(scheduler(epoch_num / self._num_epochs), 4)
          for epoch_num in range(self._num_epochs)
      ]
      expected_schedule = [
          round(scheduler_0(epoch_num / self._num_epochs), 4)
          for epoch_num in range(0, self._num_epochs, 2)
      ] + [
          round(scheduler_1(epoch_num / self._num_epochs), 4)
          for epoch_num in range(0, self._num_epochs, 2)
      ]
      self.assertEqual(scaled_schedule, expected_schedule)
  
      # Check fixed
      config["interval_scaling"] = ["fixed", "fixed"]
      scheduler = CompositeParamScheduler.from_config(config)
      fixed_schedule = [
          round(scheduler(epoch_num / self._num_epochs), 4)
          for epoch_num in range(self._num_epochs)
      ]
      expected_schedule = [
          round(scheduler_0(epoch_num / self._num_epochs), 4)
          for epoch_num in range(0, int(self._num_epochs / 2))
      ] + [
          round(scheduler_1(epoch_num / self._num_epochs), 4)
          for epoch_num in range(
              int(self._num_epochs / 2), self._num_epochs
          )
      ]
      self.assertEqual(fixed_schedule, expected_schedule)
  
      # Check that default is rescaled
      del config["interval_scaling"]
      scheduler = CompositeParamScheduler.from_config(config)
      schedule = [
          round(scheduler(epoch_num / self._num_epochs), 4)
          for epoch_num in range(self._num_epochs)
      ]
      self.assertEqual(scaled_schedule, schedule)
      # Check warmup of rescaled then fixed
      config["interval_scaling"] = ["rescaled", "fixed"]
      scheduler = CompositeParamScheduler.from_config(config)
      fixed_schedule = [
          round(scheduler(epoch_num / self._num_epochs), 4)
          for epoch_num in range(self._num_epochs)
      ]
      expected_schedule = [
          round(scheduler_0(epoch_num / self._num_epochs), 4)
          for epoch_num in range(0, int(self._num_epochs), 2)
      ] + [
          round(scheduler_1(epoch_num / self._num_epochs), 4)
          for epoch_num in range(
              int(self._num_epochs / 2), self._num_epochs
          )
      ]
      self.assertEqual(fixed_schedule, expected_schedule)
  
file_path: ClassyVision/test/optim_param_scheduler_composite_test.py
imports: import copy
  import unittest
  from classy_vision.optim.param_scheduler import build_param_scheduler
  from classy_vision.optim.param_scheduler.composite_scheduler import CompositeParamScheduler, IntervalScaling, UpdateInterval
label_desc: Use image node_id 10 for calling the TestCompositeScheduler obj's underlying member method code with example usage: obj.test_scheduler_with_mixed_types() without return types