code: def resolve_metric_as_tuple(metric):
      
      if "." in metric:
          _, metric = metric.split(".")
  
      r = [
          (operator, match) for operator, match in ALL_METRICS if match[0] == metric
      ]
      if not r or len(r) == 0:
          raise ValueError(f"Metric {metric} not recognised.")
      else:
          return r[0]
docs: Resolve metric key to a given target.
  
      :param metric: the metric name.
      :type  metric: ``str``
  
      :rtype: :class:`Metric`