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

Function randitems_from_structure

Lib/test/test_buffer.py:639–643  ·  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

637 return lshape, rshape, tuple(lslices), tuple(rslices)
638
639def randitems_from_structure(fmt, t):
640 """Return a list of random items for structure 't' with format
641 'fmtchar'."""
642 memlen, itemsize, _, _, _, _ = t
643 return gen_items(memlen//itemsize, '#'+fmt, 'numpy')
644
645def ndarray_from_structure(items, fmt, t, flags=0):
646 """Return ndarray from the tuple returned by rand_structure()"""

Calls 1

gen_itemsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…