def _invert_dependencies(deps):
    ideps = {}
    for k, v in deps.items():
        for d in v:
            l = ideps.get(d, None)
            if l:
                l.append(k)
            else:
                l = [k]
            ideps[d] = l

    return ideps
Given a dictionary of edge -> dependencies representing a DAG, "invert"
dataset/ETHPy150Open cournape/Bento/bento/commands/dependency.py/_invert_dependencies