def getLeaf(work, path):
    """get leaf/branch at *path*."""
    for x in path:
        try:
            work = work[x]
        except KeyError:
            work = None
            break
        except TypeError:
            work = None
            break
    return work
