

def nested_get(ind, coll):
    " Get nested index from collection\n\n    Examples\n    --------\n\n    >>> nested_get(1, 'abc')\n    'b'\n    >>> nested_get([1, 0], 'abc')\n    ('b', 'a')\n    >>> nested_get([[1, 0], [0, 1]], 'abc')\n    (('b', 'a'), ('a', 'b'))\n    "
    if isinstance(ind, list):
        return tuple([nested_get(i, coll) for i in ind])
    else:
        return coll[ind]

dataset/ETHPy150Open dask/dask/dask/async.py nested_get/original