def graph2edges(graph):
    # TODO(mikhaildubov): Exception on the US constitution example!
    res = ""
    node_edges = {}
    for edge in graph["edges"]:
        source_label = graph["nodes"][edge["source"]]["label"]
        target_label = graph["nodes"][edge["target"]]["label"]
        if node_edges not in source_label:
            node_edges[source_label] = []
        node_edges[source_label].append(target_label)
    for node in node_edges:
        res += "%s -> %s\n" % (node, ", ".join(node_edges[node]))
    return res
dataset/ETHPy150Open mikhaildubov/AST-text-analysis/east/formatting.py/graph2edges/swapped operands of `not in`