code: def generate_metapath():
      output_path = open(os.path.join(path, "output_path.txt"), "w")
      count = 0
  
      hg, author_names, conf_names, paper_names = construct_graph()
  
      for conf_idx in tqdm.trange(hg.num_nodes("conf")):
          traces, _ = dgl.sampling.random_walk(
              hg,
              [conf_idx] * num_walks_per_node,
              metapath=["cp", "pa", "ap", "pc"] * walk_length,
          )
          for tr in traces:
              outline = " ".join(
                  (conf_names if i % 4 == 0 else author_names)[tr[i]]
                  for i in range(0, len(tr), 2)
              )  # skip paper
              print(outline, file=output_path)
      output_path.close()
  
file_path: dgl/examples/pytorch/metapath2vec/sampler.py
imports: import os
  import random
  import sys
  import time
  import dgl
  import numpy
  import tqdm
label_desc: Use image node_id 2 for calling a global function with example usage: generate_metapath() without return types