def count_occurences(data, feature):
    """Counts how often each unique value of a feature occurs in the whole
    dataset.

    Args:
        data: The dataset to count.
        feature: The feature to count.

    Returns:
        A dictionary where the keys are the data values and the values are the
        occurences.
    """
    values = [d[feature] for d in data]
    return {k: values.count(k) for k in set(values)}