Add docstrings

This commit is contained in:
Andras Schmelczer 2022-07-12 19:16:13 +02:00
parent a1846a240e
commit 8c7a31a513
No known key found for this signature in database
GPG key ID: 0EA1BC97D0AB076E
5 changed files with 110 additions and 23 deletions

View file

@ -9,6 +9,8 @@ def unchunk(chunks: Iterable[Optional[Iterable[T]]]) -> Iterable[T]:
The inverse operation of [chunk][great_ai.utilities.chunk.chunk].
Useful for parallel processing.
Similar to itertools.chain but ignores `None` chunks.
Examples:
>>> list(unchunk([[0, 1, 2], [3, 4, 5], [6, 7, 8], [9]]))
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]