def expression_to_dot(e):
    d = {u"rdf:type": dot_type,
         HasKeyword.relation: dot_keyword,
         IsRelatedTo: lambda x, y: dot_arc(x, u"", y)}
    s = u"digraph G {{\n{0} [shape=house];\n{1}\n}}\n"
    xs = []
    for node in e.iter_nodes():
        for relation, other in e.iter_edges(node):
            node1 = adapt(node)
            node2 = adapt(other)
            relation = escape(relation, add_quotes=False)

            if d in relation:
                x = d[relation](node1, node2)
            else:
                x = dot_arc(node1, relation, node2)
            xs.append(x)
    return None, s.format(adapt(e.head), u"".join(xs))
dataset/ETHPy150Open machinalis/quepy/quepy/dot_generation.py/expression_to_dot/swapped operands of `in`