def count_distinct(dataset):
    """
    Gets a list of unique values in a dataset and computes the
    frequency of occurrence for each unique value.

    Parameters
    ----------
    dataset    : a list of values

    Returns
    -------
    a dictionary of unique values and their respective frequency 
    of occurrence    
    """            
    counts = {}

    # Loop over all elements of the dataset    
    for item in dataset:        
        if (item in counts):
            # This value is already in the dictionary. 
            # Increase its count.
            counts[item] = counts[item] + 1
        else:
            # This is the first occurrence of the word.
            # Add it to the dictionary and set its count to 1
            counts[item] = 1            
    return counts