def index_nest(nest, index):
    """Index a nested object, using a tuple of indices or keys in the case of dicts.

    Parameters
    ----------
    nest
        The nested object to index.
    index
        A tuple of indices for indexing.

    """
    ret = nest
    for i in index:
        ret = ret[i]
    return ret