from typing import Counter


def count_elements(data_lst):
    """Count how often each element occurs in a list.

    Parameters
    ----------
    data_lst : list
        List of items to count.

    Returns
    -------
    counts : collections.Counter
        Counts for how often each item occurs in the input list.
    """

    counts = Counter(data_lst)

    try:
        counts.pop(None)
    except KeyError:
        pass

    return counts