code: def _check_scores(metrics) -> Dict:
      """Validate and coerce to BaseMetric and segregate them based on predict type.
  
      Parameters
      ----------
      metrics : sktime accepted metrics object or a list of them or None
  
      Return
      ------
      metrics_type : Dict
          The key is metric types and its value is a list of its corresponding metrics.
      """
      if not isinstance(metrics, List):
          metrics = [metrics]
  
      metrics_type = {}
      for metric in metrics:
          metric = check_scoring(metric)
          # collect predict type
          if hasattr(metric, "get_tag"):
              scitype = metric.get_tag(
                  "scitype:y_pred",
                  raise_error=False,
                  tag_value_default="pred",
              )
          else:  # If no scitype exists then metric is a point forecast type
              scitype = "pred"
          if scitype not in metrics_type.keys():
              metrics_type[scitype] = [metric]
          else:
              metrics_type[scitype].append(metric)
      return metrics_type
  
file_path: sktime/sktime/forecasting/model_evaluation/_functions.py
imports: import time
  import warnings
  from typing import Dict, List, Optional, Union
  import numpy
  import pandas
  from sktime.datatypes import check_is_scitype, convert_to
  from sktime.exceptions import FitFailedWarning
  from sktime.forecasting.base import ForecastingHorizon
  from sktime.utils.parallel import parallelize
  from sktime.utils.validation._dependencies import _check_soft_dependencies
  from sktime.utils.validation.forecasting import check_cv, check_scoring
label_desc: Use image node_id 2 for calling a global function with example usage: _check_scores(metrics) and returns: metrics_type