def resolve_metric_as_tuple(metric):
    """
    Resolve metric key to a given target.

    :param metric: the metric name.
    :type  metric: ``str``

    :rtype: :class:`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]
Resolve metric key to a given target.

    :param metric: the metric name.
    :type  metric: ``str``

    :rtype: :class:`Metric`