code: def _resolve_str_metric(
      metric: str, known_metric_dict: List[MetricInfo]
  ) -> NumbaDistance:
      """Resolve a string to a NumbaDistance.
  
      Parameters
      ----------
      metric: str
          String to resolve to NumbaDistance.
      known_metric_dict: List[MetricInfo]
          List of known distance functions.
  
      Returns
      -------
      NumbaDistance
          Instance of distance resolved from string.
  
      Raises
      ------
      ValueError
          If the metric string provided is not a known distance.
      """
      for val in known_metric_dict:
          if metric in val.aka:
              return val.dist_instance
  
      raise ValueError(
          f"The metric provided: {metric}, is invalid. The current list"
          f"of supported distances is {known_metric_dict}"
      )
  
file_path: sktime/sktime/distances/_resolve_metric.py
imports: import inspect
  from typing import Callable, List, Union
  import numpy
  from sktime.distances.base import DistanceCallable, MetricInfo, NumbaDistance
label_desc: Use image node_id 3 for calling a global function with example usage: _resolve_str_metric(metric, known_metric_dict) and returns: val