code: def _check_multimetric_scoring(estimator, scoring=None):
      """Check the scoring parameter in cases when multiple metrics are allowed"""
      if (
          callable(scoring)
          or scoring is None
          or isinstance(scoring, str)
      ):
          scorers = {"score": check_scoring(estimator, scoring=scoring)}
          return scorers, False
      else:
          err_msg_generic = (
              "scoring should either be a single string or "
              "callable for single metric evaluation or a "
              "list/tuple of strings or a dict of scorer name "
              "mapped to the callable for multiple metric "
              "evaluation. Got %s of type %s"
              % (repr(scoring), type(scoring))
          )
  
          if isinstance(scoring, (list, tuple, set)):
              err_msg = (
                  "The list/tuple elements must be unique "
                  "strings of predefined scorers. "
              )
              invalid = False
              try:
                  keys = set(scoring)
              except TypeError:
                  invalid = True
              if invalid:
                  raise ValueError(err_msg)
  
              if len(keys) != len(scoring):
                  raise ValueError(
                      err_msg + "Duplicate elements were found in"
                      " the given list. %r" % repr(scoring)
                  )
              elif len(keys) > 0:
                  if not all(isinstance(k, str) for k in keys):
                      if any(callable(k) for k in keys):
                          raise ValueError(
                              err_msg
                              + "One or more of the elements were "
                              "callables. Use a dict of score name "
                              "mapped to the scorer callable. "
                              "Got %r" % repr(scoring)
                          )
                      else:
                          raise ValueError(
                              err_msg
                              + "Non-string types were found in "
                              "the given list. Got %r" % repr(scoring)
                          )
                  scorers = {
                      scorer: check_scoring(estimator, scoring=scorer)
                      for scorer in scoring
                  }
              else:
                  raise ValueError(
                      err_msg
                      + "Empty list was given. %r" % repr(scoring)
                  )
  
          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 "
                      "the given dict. scoring=%r" % repr(scoring)
                  )
              if len(keys) == 0:
                  raise ValueError(
                      "An empty dict was passed. %r" % repr(scoring)
                  )
              scorers = {
                  key: check_scoring(estimator, scoring=scorer)
                  for key, scorer in scoring.items()
              }
          else:
              raise ValueError(err_msg_generic)
          return scorers, True
  
file_path: sk-dist/skdist/distribute/utils.py
imports: import numbers
  import numpy
  from sklearn.metrics import check_scoring
  from .validation import _safe_indexing
label_desc: Use image node_id 4 for calling a global function with example usage: _check_multimetric_scoring(estimator, scoring) and returns: scorers,  False, scorers,  True