code: def make_scorer(
      name: str,
      score_func: Callable,
      *,
      optimum: float = 1.0,
      worst_possible_result: float = 0.0,
      greater_is_better: bool = True,
      needs_proba: bool = False,
      needs_threshold: bool = False,
      needs_X: bool = False,
      **kwargs: Any,
  ) -> Scorer:
      """Make a scorer from a performance metric or loss function.
  
      Factory inspired by scikit-learn which wraps scikit-learn scoring functions
      to be used in auto-sklearn.
  
      Parameters
      ----------
      name: str
          Descriptive name of the metric
  
      score_func : callable
          Score function (or loss function) with signature
          ``score_func(y, y_pred, **kwargs)``.
  
      optimum : int or float, default=1
          The best score achievable by the score function, i.e. maximum in case of
          scorer function and minimum in case of loss function.
  
      worst_possible_result : int of float, default=0
          The worst score achievable by the score function, i.e. minimum in case of
          scorer function and maximum in case of loss function.
  
      greater_is_better : boolean, default=True
          Whether score_func is a score function (default), meaning high is good,
          or a loss function, meaning low is good. In the latter case, the
          scorer object will sign-flip the outcome of the score_func.
  
      needs_proba : boolean, default=False
          Whether score_func requires predict_proba to get probability estimates
          out of a classifier.
  
      needs_threshold : boolean, default=False
          Whether score_func takes a continuous decision certainty.
          This only works for binary classification.
  
      needs_X : boolean, default=False
          Whether score_func requires X in __call__ to compute a metric.
  
      **kwargs : additional arguments
          Additional parameters to be passed to score_func.
  
      Returns
      -------
      scorer : callable
          Callable object that returns a scalar score; greater is better or set
          greater_is_better to False.
      """
      sign = 1 if greater_is_better else -1
      if needs_proba and needs_threshold:
          raise ValueError(
              "Set either needs_proba or needs_threshold to True, but not both."
          )
  
      cls = None  # type: Any
      if needs_proba:
          cls = _ProbaScorer
      elif needs_threshold:
          cls = _ThresholdScorer
      else:
          cls = _PredictScorer
      return cls(
          name,
          score_func,
          optimum,
          worst_possible_result,
          sign,
          kwargs,
          needs_X=needs_X,
      )
  
imports: from abc import ABCMeta, abstractmethod
  from typing import Any, Callable, Dict, List, Optional, Sequence, Union
  import collections
  from functools import partial
  from itertools import product
  import numpy
  import sklearn.metrics
  from sklearn.utils.multiclass import type_of_target
  from smac.utils.constants import MAXINT
  from autosklearn.constants import BINARY_CLASSIFICATION, MULTICLASS_CLASSIFICATION, MULTILABEL_CLASSIFICATION, MULTIOUTPUT_REGRESSION, REGRESSION, REGRESSION_TASKS, TASK_TYPES
  from autosklearn.data.target_validator import SUPPORTED_XDATA_TYPES
  from .util import sanitize_array
label_desc: Use image node_id 1 for calling a global function with example usage: make_scorer(name, score_func) and returns: cls