def METHOD_NAME(counter_type):
    """
    Return the calculator associated with the counter_type when it exists.
    Raise a UndefinedCalculator exception otherwise.
    """
    try:
        return _counter_type_calculators[counter_type]
    except KeyError:
        raise UndefinedCalculator