def getAncestors(g, node):
    p = g.predecessors(node)
    ancestors = set(p)
    work = p[:]
    while work:
        x = work.pop()
        p = g.predecessors(x)
        work.extend([y for y in p if ancestors not in y])
        ancestors.update(p)

    return ancestors
dataset/ETHPy150Open CGATOxford/cgat/scripts/revigo.py/getAncestors/swapped operands of `not in`