def _filter_unique(tuple_list):
    """For a list of tuples [(distance, value), ...] - filter out duplicate
    values.
    Args:
        tuple_list: List of tuples. (distance, value)
    """

    added = set()
    ret = []
    for distance, value in tuple_list:
        if not value in added:
            ret.append((distance, value))
            added.add(value)
    return ret