code: def nested_get(ind, coll):
      """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'))
      """
      if isinstance(ind, list):
          return tuple(nested_get(i, coll) for i in ind)
      else:
          return coll[ind]
  
file_path: ray/python/ray/util/dask/scheduler_utils.py
imports: import os
  from queue import Queue, Empty
  from dask import config
  from dask.callbacks import local_callbacks, unpack_callbacks
  from dask.core import _execute_task, flatten, get_dependencies, has_tasks, reverse_dict
  from dask.order import order
label_desc: Use image node_id 5 for calling a global function with example usage: nested_get(ind, coll) and returns: tuple, coll