def METHOD_NAME(knn, x, weight_fn=None, distance_fn=None):
    """Classify an observation into a class.
    If not specified, weight_fn will give all neighbors equal weight.
    distance_fn is an optional function that takes two points and returns
    the distance between them.  If distance_fn is None (the default),
    the Euclidean distance is used.
    """
    if weight_fn is None:
        weight_fn = equal_weight
    weights = calculate(knn, x, weight_fn=weight_fn, distance_fn=distance_fn)
    most_class = None
    most_weight = None
    for klass, weight in weights.items():
        if most_class is None or weight > most_weight:
            most_class = klass
            most_weight = weight
    return most_class