code: def write_evaluation_graph(cases, graph, path):
      with open(path, "w") as f:
          n1 = 0
          n2 = 0
          for e1, rel, e2 in cases:
              # (Mike, fatherOf) -> John
              # (John, fatherOf, Tom)
              rel_reverse = rel + "_reverse"
              entities1 = " ".join(list(graph[(e1, rel)]))
              entities2 = " ".join(list(graph[(e2, rel_reverse)]))
  
              n1 += len(entities1.split(" "))
              n2 += len(entities2.split(" "))
  
              data_point = {}
              data_point["e1"] = e1
              data_point["e2"] = e2
              data_point["rel"] = rel
              data_point["rel_eval"] = rel_reverse
              data_point["e2_multi1"] = entities1
              data_point["e2_multi2"] = entities2
  
              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 2 for calling a global function with example usage: write_evaluation_graph(cases, graph, path) without return types