code: def test_optimizer_params():
      optimizer = torch.optim.SGD([torch.tensor(0.0)], lr=0.01)
      wrapper = OptimizerParamsHandler(
          optimizer=optimizer, param_name="lr"
      )
      logger = NeptuneLogger(
          project="tests/dry-run",
          mode="debug",
      )
  
      mock_engine = MagicMock()
      mock_engine.state = State()
      mock_engine.state.iteration = 123
  
      wrapper(mock_engine, logger, Events.ITERATION_STARTED)
      assert_logger_called_once_with(logger, "lr/group_0", 0.01)
      logger.stop()
  
      wrapper = OptimizerParamsHandler(
          optimizer, param_name="lr", tag="generator"
      )
      logger = NeptuneLogger(
          project="tests/dry-run",
          mode="debug",
      )
  
      wrapper(mock_engine, logger, Events.ITERATION_STARTED)
      assert_logger_called_once_with(
          logger, "generator/lr/group_0", 0.01
      )
      logger.stop()
  
imports: import math
  import warnings
  from unittest.mock import MagicMock
  import pytest
  import torch
  from ignite.contrib.handlers.neptune_logger import global_step_from_engine, GradsScalarHandler, NeptuneLogger, NeptuneSaver, OptimizerParamsHandler, OutputHandler, 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