MCPcopy Create free account
hub / github.com/dask/dask / random_images

Function random_images

dask/array/tests/test_image.py:17–24  ·  view source on GitHub ↗
(n, shape)

Source from the content-addressed store, hash-verified

15
16@contextmanager
17def random_images(n, shape):
18 with tmpdir() as dirname:
19 for i in range(n):
20 fn = os.path.join(dirname, f"image.{i}.png")
21 x = np.random.randint(0, 255, size=shape).astype("u1")
22 imsave(fn, x, check_contrast=False)
23
24 yield os.path.join(dirname, "*.png")
25
26
27def test_imread():

Callers 3

test_imreadFunction · 0.85
test_preprocessFunction · 0.85

Calls 4

tmpdirFunction · 0.90
joinMethod · 0.45
astypeMethod · 0.45
randintMethod · 0.45

Tested by

no test coverage detected