code: def _validate_metrics(
      metrics: Sequence[Scorer],
      scoring_functions: Optional[List[Scorer]] = None,
  ) -> None:
      """
      Validate metrics given to Auto-sklearn. Raises an Exception in case of a problem.
  
      metrics: Sequence[Scorer]
          A list of objects that hosts a function to calculate how good the
          prediction is according to the solution.
      scoring_functions: Optional[List[Scorer]]
          A list of metrics to calculate multiple losses
      """
  
      to_score = list(metrics)
      if scoring_functions:
          to_score.extend(scoring_functions)
  
      if len(metrics) == 0:
          raise ValueError(
              "Number of metrics to compute must be greater than zero."
          )
  
      metric_counter = collections.Counter(to_score)
      metric_names_counter = collections.Counter(
          metric.name for metric in to_score
      )
      if len(metric_counter) != len(metric_names_counter):
          raise ValueError(
              "Error in metrics passed to Auto-sklearn. A metric name was used "
              "multiple times for different metrics!"
          )
  
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 2 for calling a global function with example usage: _validate_metrics(metrics, scoring_functions) without return types