Yields the list with a max size of max_chunk_size

def chunks_of(max_chunk_size, list_to_chunk):
    """
    Yields the list with a max size of max_chunk_size
    """
    for i in range(0, len(list_to_chunk), max_chunk_size):
        yield list_to_chunk[i:i + max_chunk_size]