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

Function rslices

Lib/test/test_buffer.py:731–734  ·  view source on GitHub ↗

Generate random slices for a single dimension.

(n, allow_empty=False)

Source from the content-addressed store, hash-verified

729 return randslice_from_slicelen(slicelen, n)
730
731def rslices(n, allow_empty=False):
732 """Generate random slices for a single dimension."""
733 for _ in range(5):
734 yield rslice(n, allow_empty)
735
736def rslices_ndim(ndim, shape, iterations=5):
737 """Generate random slice tuples for 'shape'."""

Callers

nothing calls this directly

Calls 1

rsliceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…