code: def test_grads_scalar_handler_wrong_setup():
      with pytest.raises(
          TypeError,
          match="Argument model should be of type torch.nn.Module",
      ):
          GradsScalarHandler(None)
  
      model = MagicMock(spec=torch.nn.Module)
      with pytest.raises(
          TypeError, match="Argument reduction should be callable"
      ):
          GradsScalarHandler(model, reduction=123)
  
      wrapper = GradsScalarHandler(model)
      mock_logger = MagicMock()
      mock_engine = MagicMock()
      with pytest.raises(
          TypeError,
          match="Handler GradsScalarHandler works only with NeptuneLogger",
      ):
          wrapper(mock_engine, mock_logger, Events.ITERATION_STARTED)
  
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 15 for calling a global function with example usage: test_grads_scalar_handler_wrong_setup() without return types