import itertools


def chunker(iterable, n):
    """
    Iterate through an iteratable in junks of at most n items
    :param iterable: iterator
    :param n: number of items in each chunk
    :return: returns an iterable with n items
    """
    class Filler(object): pass
    return (
        itertools.filterfalse(lambda x: x is Filler, chunk)
        for chunk in (itertools.zip_longest(*[iter(iterable)]*n, fillvalue=Filler))
    )