code: def _check_multimetric_scoring(estimator, scoring):
      """Check the scoring parameter in cases when multiple metrics are allowed.
  
      Parameters
      ----------
      estimator : sklearn estimator instance
          The estimator for which the scoring will be applied.
  
      scoring : list, tuple or dict
          Strategy to evaluate the performance of the cross-validated model on
          the test set.
  
          The possibilities are:
  
          - a list or tuple of unique strings;
          - a callable returning a dictionary where they keys are the metric
            names and the values are the metric scores;
          - a dictionary with metric names as keys and callables a values.
  
          See :ref:`multimetric_grid_search` for an example.
  
      Returns
      -------
      scorers_dict : dict
          A dict mapping each scorer name to its validated scorer.
      """
      err_msg_generic = (
          f"scoring is invalid (got {scoring!r}). Refer to the "
          "scoring glossary for details: "
          "https://scikit-learn.org/stable/glossary.html#term-scoring"
      )
  
      if isinstance(scoring, (list, tuple, set)):
          err_msg = "The list/tuple elements must be unique strings of predefined scorers. "
          try:
              keys = set(scoring)
          except TypeError as e:
              raise ValueError(err_msg) from e
  
          if len(keys) != len(scoring):
              raise ValueError(
                  f"{err_msg} Duplicate elements were found in"
                  f" the given list. {scoring!r}"
              )
          elif len(keys) > 0:
              if not all(isinstance(k, str) for k in keys):
                  if any(callable(k) for k in keys):
                      raise ValueError(
                          f"{err_msg} One or more of the elements "
                          "were callables. Use a dict of score "
                          "name mapped to the scorer callable. "
                          f"Got {scoring!r}"
                      )
                  else:
                      raise ValueError(
                          f"{err_msg} Non-string types were found "
                          f"in the given list. Got {scoring!r}"
                      )
              scorers = {
                  scorer: check_scoring(estimator, scoring=scorer)
                  for scorer in scoring
              }
          else:
              raise ValueError(
                  f"{err_msg} Empty list was given. {scoring!r}"
              )
  
      elif isinstance(scoring, dict):
          keys = set(scoring)
          if not all(isinstance(k, str) for k in keys):
              raise ValueError(
                  "Non-string types were found in the keys of "
                  f"the given dict. scoring={scoring!r}"
              )
          if len(keys) == 0:
              raise ValueError(f"An empty dict was passed. {scoring!r}")
          scorers = {
              key: check_scoring(estimator, scoring=scorer)
              for key, scorer in scoring.items()
          }
      else:
          raise ValueError(err_msg_generic)
      return scorers
  
imports: import copy
  import warnings
  from collections import Counter
  from functools import partial
  from inspect import signature
  from traceback import format_exc
  import numpy
  from ..base import is_regressor
  from ..utils import Bunch
  from ..utils._param_validation import HasMethods, StrOptions, validate_params
  from ..utils._response import _get_response_values
  from ..utils.metadata_routing import MetadataRequest, MetadataRouter, _MetadataRequester, _routing_enabled, get_routing_for_object, process_routing
  from ..utils.multiclass import type_of_target
  from .None import accuracy_score, average_precision_score, balanced_accuracy_score, brier_score_loss, class_likelihood_ratios, explained_variance_score, f1_score, jaccard_score, log_loss, matthews_corrcoef, max_error, mean_absolute_error, mean_absolute_percentage_error, mean_gamma_deviance, mean_poisson_deviance, mean_squared_error, mean_squared_log_error, median_absolute_error, precision_score, r2_score, recall_score, roc_auc_score, top_k_accuracy_score
  from .cluster import adjusted_mutual_info_score, adjusted_rand_score, completeness_score, fowlkes_mallows_score, homogeneity_score, mutual_info_score, normalized_mutual_info_score, rand_score, v_measure_score
label_desc: Use image node_id 3 for calling a global function with example usage: _check_multimetric_scoring(estimator, scoring) and returns: scorers