def _chunks(l, chunk_size):
    """return chunks of chunk_size for list l

    >>> list(chunks([0, 1, 2, 3, 4], 2))
    [[0, 1], [2, 3], [4]]
    """
    return (l[i:i + chunk_size] for i in range(0, len(l), chunk_size))