def grouper(list_, n):
    """
    Collect data into fixed-length chunks or blocks
    Adapt from https://docs.python.org/3/library/itertools.html#itertools-recipes
    
    >>> list(grouper('ABCDEF', 3))
    [("A", "B", "C"), ("D", "E")]
    """
    assert len(list_) % n == 0
    args = [iter(list_)] * n
    return zip(*args)