def chunked(iterable, n):
    iterable = iter(iterable)
    while 1:
        t = tuple(islice(iterable, n))
        if t:
            yield t
        else:
            return
Returns chunks of n length of iterable
dataset/ETHPy150Open mrgambal/vulyk/vulyk/utils.py/chunked