code: def test_hook(self):
      task = self._build_task(num_epochs=3)
  
      lr_list = []
      weight_decay_list = []
      momentum_list = []
  
      test_instance = self
  
      class TestHook(ClassyHook):
          on_start = ClassyHook._noop
          on_phase_start = ClassyHook._noop
          on_phase_end = ClassyHook._noop
          on_end = ClassyHook._noop
  
          def on_step(self, task: ClassyTask) -> None:
              if not task.train:
                  return
  
              # make sure we have non-zero param groups
              test_instance.assertGreater(
                  len(task.optimizer.param_groups), 0
              )
              lr_list.append(task.optimizer.options_view.lr)
              weight_decay_list.append(
                  task.optimizer.options_view.weight_decay
              )
              momentum_list.append(task.optimizer.options_view.momentum)
  
      task.set_hooks([TestHook()])
  
      trainer = LocalTrainer()
      trainer.train(task)
  
      # We have 10 samples, batch size is 5. Each epoch takes two steps. So,
      # there will be a total of 6 steps.
      # the lr scheduler uses a step update interval
      self.assertEqual(
          lr_list, [0 / 6, 1 / 6, 2 / 6, 3 / 6, 4 / 6, 5 / 6]
      )
      # the weight decay scheduler uses an epoch update interval
      self.assertEqual(
          weight_decay_list, [0 / 6, 0 / 6, 4 / 6, 4 / 6, 8 / 6, 8 / 6]
      )
      self.assertEqual(momentum_list, [0.9, 0.9, 0.9, 0.9, 0.9, 0.9])
  
imports: import unittest
  from unittest.mock import Mock
  from classy_vision.dataset import build_dataset
  from classy_vision.hooks import ClassyHook
  from classy_vision.losses import build_loss
  from classy_vision.models import build_model
  from classy_vision.optim import build_optimizer, build_optimizer_schedulers
  from classy_vision.optim.param_scheduler import ClassyParamScheduler, register_param_scheduler, UpdateInterval
  from classy_vision.tasks import ClassificationTask, ClassyTask
  from classy_vision.trainer import LocalTrainer
label_desc: Use image node_id 7 for calling the TestParamSchedulerIntegration obj's underlying member method code with example usage: obj.test_hook() without return types