MCPcopy Index your code
hub / github.com/dask/dask / normalize_slice

Function normalize_slice

dask/array/optimization.py:190–203  ·  view source on GitHub ↗

Replace Nones in slices with integers >>> normalize_slice(slice(None, None, None)) slice(0, None, 1)

(s)

Source from the content-addressed store, hash-verified

188
189
190def normalize_slice(s):
191 """Replace Nones in slices with integers
192
193 >>> normalize_slice(slice(None, None, None))
194 slice(0, None, 1)
195 """
196 start, stop, step = s.start, s.stop, s.step
197 if start is None:
198 start = 0
199 if step is None:
200 step = 1
201 if start < 0 or step < 0 or stop is not None and stop < 0:
202 raise NotImplementedError()
203 return slice(start, stop, step)
204
205
206def check_for_nonfusible_fancy_indexing(fancy, normal):

Callers 1

fuse_sliceFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…