[Bug] - The `batched` function delivers empty batches
The function batched
is used to divide larger sets of elements (provided as an iterable
) into batches of a predefined size. However, when the number of elements is a whole multiple of the batch size, the function delivers an additional empty batch at the end. This can easily be fixed by checking for a non-empty list before yielding the last batch.