code: def main(args):
      """
      The main fucntion to run the algorithm struc2vec
      """
      if args.train:
          dataset = EdgeDataset(
              undirected=args.undirected, data_dir=args.edge_file
          )
          graph = StrucVecGraph(
              dataset.graph,
              dataset.nodes,
              args.opt1,
              args.opt2,
              args.opt3,
              args.depth,
              args.num_walks,
              args.walk_depth,
          )
          graph.output_degree_with_depth(args.depth, args.opt1)
          graph.calc_distances_between_nodes()
          graph.normlization_layer_weight()
          graph.random_walk_structual_sim()
          learning_embedding_from_struc2vec(args)
          file_label = open(args.label_file)
          file_label_reindex = open(args.label_file + "_reindex", "w")
          for line in file_label:
              items = line.strip("\n\r").split(" ")
              try:
                  items = [int(item) for item in items]
              except:
                  continue
              if items[0] not in dataset.node_dict:
                  continue
              reindex = dataset.node_dict[items[0]]
              file_label_reindex.write(
                  str(reindex) + " " + str(items[1]) + "\n"
              )
          file_label_reindex.close()
  
      if args.valid:
          emb_file = open(args.emb_file)
          file_label_reindex = open(args.label_file + "_reindex")
          label_dict = dict()
          for line in file_label_reindex:
              items = line.strip("\n\r").split(" ")
              try:
                  label_dict[int(items[0])] = int(items[1])
              except:
                  continue
  
          data_for_train_valid = []
          for line in emb_file:
              items = line.strip("\n\r").split(" ")
              if len(items) <= 2:
                  continue
              index = int(items[0])
              label = int(label_dict[index])
              sample = []
              sample.append(index)
              feature_emb = items[1:]
              feature_emb = [float(feature) for feature in feature_emb]
              sample.extend(feature_emb)
              sample.append(label)
              data_for_train_valid.append(sample)
          train_lr_l2_model(args, data_for_train_valid)
  
imports: import argparse
  import math
  import random
  import numpy
  import pgl
  from pgl import graph
  from pgl.graph_kernel import alias_sample_build_table
  from pgl.sample import alias_sample
  from data_loader import EdgeDataset
  from classify import train_lr_model
  from sklearn_classify import train_lr_l2_model
label_desc: Use image node_id 3 for calling a global function with example usage: main(args) without return types