import itertools


def group(n, iterable):
    """Collates the iterable into groups n items long."""
    # https://docs.python.org/3.1/library/itertools.html#recipes
    args = [iter(iterable)] * n
    return itertools.zip_longest(*args)