def evaluate_paths(stops: list, all_paths: list, transfer_minutes: float, score_function):
    """
    Evaluates paths, returning a sorted tuple with the stop name and score.
    The lower score the better -> meaning its closer to everybody.

    Takes all available stops, calculated paths, time it takes to make a transfer in minutes
    and score function for calculation score out of distances.
    """
    scores = []
    for stop in stops:
        distances = []

        for path in all_paths:
            if not stop in path:
                break
            distances.append(path[stop]["distance_min"] + path[stop]["transfers"] * transfer_minutes)

        if len(distances) == len(all_paths):
            score = score_function(distances)
            scores.append((stop, score))

    scores.sort(key=lambda tup: tup[1])

    return scores