def nested_get(ind, coll):
 if isinstance(ind, list):
  return tuple([nested_get(i, coll) for i in ind])
 else:
  return coll[ind]

def nested_get ( ind , coll ) : if isinstance ( ind , list ) : return tuple ( [ nested_get ( i , coll ) for i in ind ] ) else : return coll [ ind ]
get nested index from collection examples .