MCPcopy Create free account
hub / github.com/dask/dask / nested_get

Function nested_get

dask/local.py:320–336  ·  view source on GitHub ↗

Get nested index from collection Examples -------- >>> nested_get(1, 'abc') 'b' >>> nested_get([1, 0], 'abc') ('b', 'a') >>> nested_get([[1, 0], [0, 1]], 'abc') (('b', 'a'), ('a', 'b'))

(ind, coll)

Source from the content-addressed store, hash-verified

318
319
320def nested_get(ind, coll):
321 """Get nested index from collection
322
323 Examples
324 --------
325
326 >>> nested_get(1, 'abc')
327 'b'
328 >>> nested_get([1, 0], 'abc')
329 ('b', 'a')
330 >>> nested_get([[1, 0], [0, 1]], 'abc')
331 (('b', 'a'), ('a', 'b'))
332 """
333 if isinstance(ind, list):
334 return tuple(nested_get(i, coll) for i in ind)
335 else:
336 return coll[ind]
337
338
339def default_get_id():

Callers 1

get_asyncFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected