def metric(name):
    """
    Return the metric with the given name, if any

    Raise InvalidMetricError if the given name has not been registered
    """

    try:
        return REGISTRY[name]
    except __HOLE__ as e:
        raise InvalidMetricError("Metric {} not found!".format(e))
dataset/ETHPy150Open avalente/appmetrics/appmetrics/metrics.py/metric