code: def _process_metric_input(metrics: Metrics) -> List[Metric]:
      """A private helper method which processes metrics correctly.
  
      Metrics can be input as `dc.metrics.Metric` objects, lists of
      `dc.metrics.Metric` objects, or as raw metric functions or lists of
      raw metric functions. Metric functions are functions which accept
      two arguments `y_true, y_pred` both of which must be `np.ndarray`
      objects and return a float value. This functions normalizes these
      different types of inputs to type `list[dc.metrics.Metric]` object
      for ease of later processing.
  
      Note that raw metric functions which don't have names attached will
      simply be named "metric-#" where # is their position in the provided
      metric list. For example, "metric-1" or "metric-7"
  
      Parameters
      ----------
      metrics: dc.metrics.Metric/list[dc.metrics.Metric]/metric function/ list[metric function]
          Input metrics to process.
  
      Returns
      -------
      final_metrics: list[dc.metrics.Metric]
          Converts all input metrics and outputs a list of
          `dc.metrics.Metric` objects.
      """
      # Make sure input is a list
      if not isinstance(metrics, list):
          # FIXME: Incompatible types in assignment
          metrics = [metrics]  # type: ignore
  
      final_metrics = []
      # FIXME: Argument 1 to "enumerate" has incompatible type
      for i, metric in enumerate(metrics):  # type: ignore
          # Ensure that metric is wrapped in a list.
          if isinstance(metric, Metric):
              final_metrics.append(metric)
          # This case checks if input is a function then wraps a
          # dc.metrics.Metric object around it
          elif callable(metric):
              wrap_metric = Metric(metric, name="metric-%d" % (i + 1))
              final_metrics.append(wrap_metric)
          else:
              raise ValueError(
                  "metrics must be one of metric function / dc.metrics.Metric object /"
                  "list of dc.metrics.Metric or metric functions."
              )
      return final_metrics
  
imports: import csv
  import logging
  import warnings
  from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union
  import numpy
  import deepchem
  from deepchem.metrics import Metric
label_desc: Use image node_id 3 for calling a global function with example usage: _process_metric_input(metrics) and returns: final_metrics