code: def test_optimizer_params():
      optimizer = torch.optim.SGD([torch.tensor(0.0)], lr=0.01)
      wrapper = OptimizerParamsHandler(
          optimizer=optimizer, param_name="lr"
      )
      mock_logger = MagicMock(spec=TensorboardLogger)
      mock_logger.writer = MagicMock()
      mock_engine = MagicMock()
      mock_engine.state = State()
      mock_engine.state.iteration = 123
  
      wrapper(mock_engine, mock_logger, Events.ITERATION_STARTED)
      mock_logger.writer.add_scalar.assert_called_once_with(
          "lr/group_0", 0.01, 123
      )
  
      wrapper = OptimizerParamsHandler(
          optimizer, param_name="lr", tag="generator"
      )
      mock_logger = MagicMock(spec=TensorboardLogger)
      mock_logger.writer = MagicMock()
  
      wrapper(mock_engine, mock_logger, Events.ITERATION_STARTED)
      mock_logger.writer.add_scalar.assert_called_once_with(
          "generator/lr/group_0", 0.01, 123
      )
  
imports: import math
  import os
  from unittest.mock import ANY, call, MagicMock, patch
  import pytest
  import torch
  from ignite.contrib.handlers.tensorboard_logger import global_step_from_engine, GradsHistHandler, GradsScalarHandler, OptimizerParamsHandler, OutputHandler, TensorboardLogger, WeightsHistHandler, WeightsScalarHandler
  from ignite.engine import Engine, Events, State
label_desc: Use image node_id 3 for calling a global function with example usage: test_optimizer_params() without return types