def compute_scores_on_distance_measure(first_data, memento_data,
    distance_function):
    """Calculates the distance between scores for those measures that use
    functions from the distance library.
    """
    score = None
    if len(memento_data) == 0:
        if len(first_data) == 0:
            score = 0
        else:
            score = distance_function(first_data, memento_data)
    else:
        score = distance_function(first_data, memento_data)
    return score
