MCPcopy Index your code
hub / github.com/RustPython/RustPython / randitems_from_structure

Function randitems_from_structure

Lib/test/test_buffer.py:627–631  ·  view source on GitHub ↗

Return a list of random items for structure 't' with format 'fmtchar'.

(fmt, t)

Source from the content-addressed store, hash-verified

625 return lshape, rshape, tuple(lslices), tuple(rslices)
626
627def randitems_from_structure(fmt, t):
628 """Return a list of random items for structure 't' with format
629 'fmtchar'."""
630 memlen, itemsize, _, _, _, _ = t
631 return gen_items(memlen//itemsize, '#'+fmt, 'numpy')
632
633def ndarray_from_structure(items, fmt, t, flags=0):
634 """Return ndarray from the tuple returned by rand_structure()"""

Calls 1

gen_itemsFunction · 0.85

Tested by

no test coverage detected