def _get_by_path(tree, keys):
    'Access a nested object in tree by sequence of keys.'
    return reduce(getitem, keys, tree)
Access a nested object in tree by sequence of keys.
def _get_by_path(tree, keys):
    
    return reduce(getitem, keys, tree)