def recursiveIndex(nestedList, query):
    """
    Find index of element (first occurrence) in an arbitrarily nested list.

    Args:
        nestedList(list): list object to search in
        query: target element to find

    Returns:
        list: Position indices
    """
    for index, element in enumerate(nestedList):
        if isinstance(element, (list, tuple)):
            path = recursiveIndex(element, query)
            if path:
                return [index] + path
        if element == query:
            return [index]
    return []