import typing


def get_path(action: typing.Dict[str, typing.Any], path_delim: str) -> typing.List[str]:
    """
    Get path from action
    :param action: action object
    :param path_delim: delimiter to be used to split path into keys.
        (Not used when path is list)
    :return: list of keys
    """
    path = action["path"]
    if isinstance(path, str):
        keys = [str(key) for key in action["path"].split(path_delim)]
        return keys
    elif isinstance(path, typing.List) and all(isinstance(key, str) for key in path):
        return path
    else:
        raise TypeError(
            "Action {}: path should be str or list of strings".format(action)
        )