def select_closest(candidates, origin):
    """Return the index of the closest candidate to a given point."""
    return euclidean_distance(candidates, origin).argmin()
Return the index of the closest candidate to a given point.
src/distance.py