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

Function _validate_indexer

dask/array/_array_expr/_shuffle.py:17–29  ·  view source on GitHub ↗
(chunks, indexer, axis)

Source from the content-addressed store, hash-verified

15
16
17def _validate_indexer(chunks, indexer, axis):
18 if not isinstance(indexer, list) or not all(isinstance(i, list) for i in indexer):
19 raise ValueError("indexer must be a list of lists of positional indices")
20
21 if not axis <= len(chunks):
22 raise ValueError(
23 f"Axis {axis} is out of bounds for array with {len(chunks)} axes"
24 )
25
26 if max(map(max, indexer)) >= sum(chunks[axis]):
27 raise IndexError(
28 f"Indexer contains out of bounds index. Dimension only has {sum(chunks[axis])} elements."
29 )
30
31
32def _shuffle(x, indexer, axis, name):

Callers 1

_shuffleFunction · 0.70

Calls 3

allFunction · 0.85
maxFunction · 0.85
sumFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…