MCPcopy Index your code
hub / github.com/tortoise/tortoise-orm / batched

Function batched

tortoise/utils.py:14–17  ·  view source on GitHub ↗
(iterable: Iterable[Any], n: int)

Source from the content-addressed store, hash-verified

12 from itertools import islice
13
14 def batched(iterable: Iterable[Any], n: int) -> Iterable[tuple[Any]]:
15 it = iter(iterable)
16 while batch := tuple(islice(it, n)):
17 yield batch
18
19
20if TYPE_CHECKING: # pragma: nocoverage

Callers 1

chunkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…