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


def _traverse(tree: Dict[str, Any], active_branch: List[str]) -> Any:
    """Traverses the tree-structure configuration dictionary

    :param tree: The configuration dictionary
    :param active_branch: A list of node names in the branch of interest
    :return: A subtree or value of a leaf
    """
    if len(active_branch) > 1:
        return _traverse(tree[active_branch[0]], active_branch[1:])
    else:
        return tree[active_branch[0]]