r"""
    Returns nested subset of items_list

    Args:
        items_list (list):
        unflat_index_list (list): nested list of indices

    CommandLine:
        python -m utool.util_list --exec-unflat_take

    SeeAlso:
        ut.take

    Example:
        >>> # DISABLE_DOCTEST
        >>> from utool.util_list import *  # NOQA
        >>> items_list = [1, 2, 3, 4, 5]
        >>> unflat_index_list = [[0, 1], [2, 3], [0, 4]]
        >>> result = unflat_take(items_list, unflat_index_list)
        >>> print(result)
        [[1, 2], [3, 4], [1, 5]]

def unflat_take(items_list, unflat_index_list):
    r"""
    Returns nested subset of items_list

    Args:
        items_list (list):
        unflat_index_list (list): nested list of indices

    CommandLine:
        python -m utool.util_list --exec-unflat_take

    SeeAlso:
        ut.take

    Example:
        >>> # DISABLE_DOCTEST
        >>> from utool.util_list import *  # NOQA
        >>> items_list = [1, 2, 3, 4, 5]
        >>> unflat_index_list = [[0, 1], [2, 3], [0, 4]]
        >>> result = unflat_take(items_list, unflat_index_list)
        >>> print(result)
        [[1, 2], [3, 4], [1, 5]]
    """
    return [unflat_take(items_list, xs)
            if isinstance(xs, list) else
            take(items_list, xs)
            for xs in unflat_index_list]