from typing import Union
from typing import Tuple
from typing import List
from typing import Any


def deep_tuple_to_list(inp: Union[Tuple, List]) -> List[Any]:
    """Transform a nested tuple to a nested list.

    Parameters
    ----------
    inp: Union[Tuple, List]
        The input object.

    Returns
    -------
    ret: List[Any]
        The nested list.
    """
    return list(map(deep_tuple_to_list, inp)) if isinstance(inp, (list, tuple)) else inp