def _produce_scores(scores, exp):
    """Produces the scores dictionary.

    Args:
        scores: Is either the score dictionary, or a function that produces the
                score dictionary based on an experiment.
        exp: The experiment ojbect.
    Returns:
        The dictionary of scores.
    """
    if isinstance(scores, dict):
        return scores
    return scores(exp)