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

Function indices

Lib/test/test_buffer.py:336–339  ·  view source on GitHub ↗

Generate all possible tuples of indices.

(shape)

Source from the content-addressed store, hash-verified

334 return _fa(items, shape)
335
336def indices(shape):
337 """Generate all possible tuples of indices."""
338 iterables = [range(v) for v in shape]
339 return product(*iterables)
340
341def getindex(ndim, ind, strides):
342 """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

Used in the wild real call sites across dependent graphs

searching dependent graphs…