collections.chunk Split a list into consecutive batches of at most n items, in order; the last batch may be short. chunk in Python collectionschunkbatchsplit 1.0.0py rs ts11 tests