def count(values):
    """
    Returns a dict of counts for each value in the iterable.
    """
    counts = dict()
    for v in values:
        if v not in counts:
            counts[v] = 0
        counts[v] += 1
    return counts