from typing import Dict
from typing import Any
from typing import List


def get_leaf_paths(tree: Dict[str, Any]) -> List[List[str]]:
    """
    Find all paths
    Had to write the "helper" function due to
    some sort of weird persistence of the accumulator b/w calls!

    Cf https://stackoverflow.com/questions/60039297/
    return-a-list-of-paths-to-leaf-nodes-from-a-nested-list-of-lists
    """
    def helper(tree: Dict[str, Any], path: List[Any],
               acc: List[Any]) -> List[List[str]]:
        for node, children in tree.items():
            if children:  # not leaf
                helper(children, path + [node], acc)
            else:
                acc.append(path + [node])

        return acc

    return helper(tree, [], [])