def rslices_ndim(ndim, shape, iterations=5):
 for _ in range(iterations):
  (yield tuple((rslice(shape[n]) for n in range(ndim))))
 for _ in range(iterations):
  (yield tuple((rslice(shape[n], allow_empty=True) for n in range(ndim))))
 (yield tuple((slice(0, 1, 0) for _ in range(ndim))))

def rslices_ndim ( ndim , shape , iterations = 5 ) : for _ in range ( iterations ) : ( yield tuple ( ( rslice ( shape [ n ] ) for n in range ( ndim ) ) ) ) for _ in range ( iterations ) : ( yield tuple ( ( rslice ( shape [ n ] , allow_empty = True ) for n in range ( ndim ) ) ) ) ( yield tuple ( ( slice ( 0 , 1 , 0 ) for _ in range ( ndim ) ) ) )
generate random slice tuples for shape .