MCPcopy Index your code
hub / github.com/python/cpython / chunks

Function chunks

Lib/test/test_shutil.py:86–92  ·  view source on GitHub ↗
(total, step)

Source from the content-addressed store, hash-verified

84def write_test_file(path, size):
85 """Create a test file with an arbitrary size and random text content."""
86 def chunks(total, step):
87 assert total >= step
88 while total > step:
89 yield step
90 total -= step
91 if total:
92 yield total
93
94 bufsize = min(size, 8192)
95 chunk = b"".join([random.choice(string.ascii_letters).encode()

Callers 2

setUpClassMethod · 0.85
write_test_fileFunction · 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…