code: def write_training_graph(cases, graph, path):
      with open(path, "w") as f:
          for key in graph:
              e1, rel = key
              # (Mike, fatherOf, John)
              # (John, fatherOf, Tom)
              # (John, fatherOf_reverse, Mike)
              # (Tom, fatherOf_reverse, John)
  
              # (John, fatherOf) -> Tom
              # (John, fatherOf_reverse, Mike)
              entities1 = " ".join(list(graph[key]))
  
              data_point = {}
              data_point["e1"] = e1
              data_point["e2"] = "None"
              data_point["rel"] = rel
              data_point["rel_eval"] = "None"
              data_point["e2_multi1"] = entities1
              data_point["e2_multi2"] = "None"
  
              f.write(json.dumps(data_point) + "\n")
  
imports: from __future__ import print_function
  import json
  import sys
  from os.path import join
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: write_training_graph(cases, graph, path) without return types