code: def generate_graph():
      with open(FLAGS.output, "w+") as f:
          for _ in range(FLAGS.num_edges):
              s = np.random.randint(FLAGS.num_entities)
              r = np.random.randint(FLAGS.num_relations)
              t = np.random.randint(FLAGS.num_entities)
              while t != s:
                  t = np.random.randint(FLAGS.num_entities)
              f.write("%d\t%d\t%d\n" % (s, r, t))
  
file_path: neural-structured-learning/research/a2n/generate_random_graph.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl import app
  from absl import flags
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: generate_graph() without return types