def get_parents(all_parents, current):
    for parent in all_parents.get(current, []):
        yield parent
        for grandparent in get_parents(all_parents, parent):
            yield grandparent
Iterate current object's all parents.
dataset/ETHPy150Open tonyseek/simple-rbac/rbac/acl.py/get_parents