MCPcopy Create free account
hub / github.com/FreedomGu/Diffportrait360 / chunk

Function chunk

diffportrait360_release/code/utils/utils.py:58–66  ·  view source on GitHub ↗
(iterable, chunk_size)

Source from the content-addressed store, hash-verified

56 return results
57
58def chunk(iterable, chunk_size):
59 ret = []
60 for record in iterable:
61 ret.append(record)
62 if len(ret) == chunk_size:
63 yield ret
64 ret = []
65 if ret:
66 yield ret
67

Callers

nothing calls this directly

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected