code: def history_cls(self, request):
      # run tests once with default History, once with DistributedHistory
      from skorch.history import DistributedHistory, History
      from skorch._version import Version
  
      if request.param == "single":
          return History
  
      if request.param == "distributed":
          # TODO: remove this once PyTorch 1.11 is no longer supported
          version_torch = Version(torch.__version__)
          if version_torch < Version("1.12.0"):
              # Tests with DistributedHistory are flaky with PyTorch 1.11 and when
              # using pytest on CI. Running directly, i.e. without pytest, does
              # not appear to cause issues.
              pytest.skip(
                  msg="Skipping multiprocessing for PyTorch < 1.12"
              )
  
          store = TCPStore(
              "127.0.0.1", port=1234, world_size=1, is_master=True
          )
          return partial(
              DistributedHistory, store=store, rank=0, world_size=1
          )
  
      raise ValueError(
          "Incorrect pytest request parameter '{request.param}'"
      )
  
imports: import pickle
  import time
  import multiprocessing
  from functools import partial
  import numpy
  import pytest
  import torch
  from torch.distributed import TCPStore
  from sklearn.datasets import make_classification
label_desc: Use image node_id 1 for calling the TestHistory obj's underlying member method code with example usage: obj.history_cls(request) and returns: History, partial