code: def build_node_types(meta_node, outfile):
      """build_node_types"""
      nt_ori2new = {}
      with open(outfile, "w") as writer:
          offset = 0
          for node_type, num_nodes in meta_node.items():
              ori_id2new_id = {}
              for i in range(num_nodes):
                  writer.write("%d\t%s\n" % (offset + i, node_type))
                  ori_id2new_id[i + 1] = offset + i
              nt_ori2new[node_type] = ori_id2new_id
              offset += num_nodes
      return nt_ori2new
  
file_path: PGL/legacy/examples/distribute_metapath2vec/data_process.py
imports: import sys
  import os
  import argparse
  import numpy
  from collections import OrderedDict
label_desc: Use image node_id 1 for calling a global function with example usage: build_node_types(meta_node, outfile) and returns: nt_ori2new