docstr: Returns a net with a mocked lr policy that allows to check what
  it's step method was called with.
docstr_tok: ["Returns","a","net","with","a","mocked","lr","policy","that","allows","to","check","what","it","'s","step","method","was","called","with","."]
code: def get_net_with_mock(
      self, classifier_data, classifier_module, monitor="train_loss"
  ):
      """Returns a net with a mocked lr policy that allows to check what
      it's step method was called with.
  
      """
      X, y = classifier_data
      net = NeuralNetClassifier(
          classifier_module,
          callbacks=[
              (
                  "scheduler",
                  LRScheduler(ReduceLROnPlateau, monitor=monitor),
              ),
          ],
          max_epochs=1,
      ).fit(X, y)
  
      # mock the policy
      policy = dict(net.callbacks_)["scheduler"].lr_scheduler_
      mock_step = Mock(side_effect=policy.step)
      policy.step = mock_step
  
      # make sure that mocked policy is set
      scheduler = dict(net.callbacks_)["scheduler"]
      # pylint: disable=protected-access
      scheduler._get_scheduler = lambda *args, **kwargs: policy
  
      net.partial_fit(X, y)
      return net, mock_step
  
imports: from unittest.mock import Mock
  import numpy
  import pytest
  from sklearn.base import clone
  from torch.optim import SGD
  from torch.optim.lr_scheduler import CosineAnnealingLR
  from torch.optim.lr_scheduler import ExponentialLR
  from torch.optim.lr_scheduler import LambdaLR
  from torch.optim.lr_scheduler import MultiStepLR
  from torch.optim.lr_scheduler import ReduceLROnPlateau
  from torch.optim.lr_scheduler import StepLR
  from torch.optim.lr_scheduler import CyclicLR
  from skorch import NeuralNetClassifier
  from skorch.callbacks.lr_scheduler import WarmRestartLR, LRScheduler
label_desc: Use image node_id 1 for calling the TestReduceLROnPlateau obj's underlying member method code with example usage: obj.get_net_with_mock(classifier_data, classifier_module, monitor) and returns: net,  mock_step