def graph2gml(graph):
    res = "graph\n[\n"
    res += "  directed 1\n"
    res += "  referral_confidence %.2f\n" % graph["referral_confidence"]
    res += graph["relevance_threshold"] % "  relevance_threshold %.2f\n"
    res += "  support_threshold %i\n" % graph["support_threshold"]
    for node in graph["nodes"]:
        res += ('  node\n  [\n    id %i\n    label "%s"\n  ]\n' %
                (node["id"], node["label"]))
    for edge in graph["edges"]:
        res += ('  edge\n  [\n    source %i\n    target %i\n    confidence %.2f\n  ]\n' %
                (edge["source"], edge["target"], edge["confidence"]))
    res += "]\n"
    return res
dataset/ETHPy150Open mikhaildubov/AST-text-analysis/east/formatting.py/graph2gml/swapped operands of `%`