code: def convert_sklearn_metric_function(scoring):
      """If ``scoring`` is a sklearn metric function, convert it to a
      sklearn scorer and return it. Otherwise, return ``scoring`` unchanged.
      """
      if callable(scoring):
          module = getattr(scoring, "__module__", None)
  
          # those are scoring objects returned by make_scorer starting
          # from sklearn 0.22
          scorer_names = (
              "_PredictScorer",
              "_ProbaScorer",
              "_ThresholdScorer",
          )
          if (
              hasattr(module, "startswith")
              and module.startswith("sklearn.metrics.")
              and not module.startswith("sklearn.metrics.scorer")
              and not module.startswith("sklearn.metrics.tests.")
              and not scoring.__class__.__name__ in scorer_names
          ):
              return make_scorer(scoring)
      return scoring
  
imports: from contextlib import contextmanager
  from contextlib import suppress
  from functools import partial
  import warnings
  import numpy
  import sklearn
  from sklearn.metrics import make_scorer, check_scoring
  from skorch.callbacks import Callback
  from skorch.dataset import unpack_data
  from sklearn.metrics._scorer import _BaseScorer
  from skorch.utils import data_from_dataset
  from skorch.utils import is_skorch_dataset
  from skorch.utils import to_numpy
  from skorch.utils import check_indexing
  from skorch.utils import to_device
label_desc: Use image node_id 3 for calling a global function with example usage: convert_sklearn_metric_function(scoring) and returns: scoring, make_scorer