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

Function indices

Lib/test/test_buffer.py:324–327  ·  view source on GitHub ↗

Generate all possible tuples of indices.

(shape)

Source from the content-addressed store, hash-verified

322 return _fa(items, shape)
323
324def indices(shape):
325 """Generate all possible tuples of indices."""
326 iterables = [range(v) for v in shape]
327 return product(*iterables)
328
329def getindex(ndim, ind, strides):
330 """Convert multi-dimensional index to the position in the flat list."""

Callers 3

transposeFunction · 0.85
is_overlappingFunction · 0.85
verifyMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected