def get(tree, s):
    """Get the tree node or full pathname for a specified
    tuple of indices such as (1, 3, 2).  Returns None if not found."""
    if len(s) == 0:
        return 'top', tree
    name, e = tree[s[0]]
    if len(s) == 1:
        return name, e
    return get(e, s[1:])