MCPcopy
hub / github.com/dask/dask / deepfirst

Function deepfirst

dask/array/core.py:5464–5473  ·  view source on GitHub ↗

First element in a nested list >>> deepfirst([[[1, 2], [3, 4]], [5, 6], [7, 8]]) 1

(seq)

Source from the content-addressed store, hash-verified

5462
5463
5464def deepfirst(seq):
5465 """First element in a nested list
5466
5467 >>> deepfirst([[[1, 2], [3, 4]], [5, 6], [7, 8]])
5468 1
5469 """
5470 if not isinstance(seq, (list, tuple)):
5471 return seq
5472 else:
5473 return deepfirst(seq[0])
5474
5475
5476def shapelist(a):

Callers 3

chunks_from_arraysFunction · 0.85
concatenate3Function · 0.85
concatenate_axesFunction · 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…