def count_reps(seq):
    """Counts number occurrences of each value in the sequence."""
    result = defaultdict(int)
    for item in seq:
        result[item] += 1
    return result
Counts number occurrences of each value in the sequence.
funcy/seqs.py