def chunks(iterable, size):
    """
    Yield successive chunks from `iterable`, being `size` long.

    https://stackoverflow.com/a/55776536/3423324

    :param iterable: The object you want to split into pieces.
    :param size: The size each of the resulting pieces should have.
    """
    i = 0
    while True:
        sliced = iterable[i:i + size]
        if len(sliced) == 0:
            break
        yield sliced
        if len(sliced) < size:
            break
        i += size
