def batch()

in src_lambda/main.py [0:0]


def batch(iterable, batch_limit, fillvalue):
    """
    Batch a iterable into splits of size batch_limit
    """
    if batch_limit < 1:
        raise ValueError('Number of elements to bulk together cannot be smaller than 1')
    elements = batch_limit * [iter(iterable)]
    return zip_longest(fillvalue=fillvalue, *elements)