code: def main(args):
      hidden_size = args.hidden_size
      neg_num = args.neg_num
      epoch = args.epoch
      p = args.p
      q = args.q
      save_path = args.save_path
      batch_size = args.batch_size
      walk_len = args.walk_len
      win_size = args.win_size
  
      if not os.path.isdir(save_path):
          os.makedirs(save_path)
      dataset = load(args.dataset)
  
      if args.offline_learning:
          log.info("Start random walk on disk...")
          walk_save_path = os.path.join(save_path, "walks")
          if not os.path.isdir(walk_save_path):
              os.makedirs(walk_save_path)
          pool = Pool(args.processes)
          args_list = [
              (
                  x,
                  dataset.graph,
                  walk_save_path,
                  1,
                  batch_size,
                  walk_len,
                  p,
                  q,
                  np.random.randint(2**32, dtype="int64"),
              )
              for x in range(epoch)
          ]
          pool.map(process, args_list)
          filelist = glob.glob(os.path.join(walk_save_path, "*"))
          log.info("Random walk on disk Done.")
      else:
          filelist = None
  
      train_steps = int(dataset.graph.num_nodes / batch_size) * epoch
  
      place = fluid.CUDAPlace(0) if args.use_cuda else fluid.CPUPlace()
      node2vec_prog = fluid.Program()
      startup_prog = fluid.Program()
  
      with fluid.program_guard(node2vec_prog, startup_prog):
          with fluid.unique_name.guard():
              node2vec_pyreader, node2vec_loss = node2vec_model(
                  dataset.graph,
                  hidden_size=hidden_size,
                  neg_num=neg_num,
              )
              lr = l.polynomial_decay(0.025, train_steps, 0.0001)
              adam = fluid.optimizer.Adam(lr)
              adam.minimize(node2vec_loss)
  
      node2vec_pyreader.decorate_tensor_provider(
          node2vec_generator(
              dataset.graph,
              batch_size=batch_size,
              walk_len=walk_len,
              win_size=win_size,
              epoch=epoch,
              neg_num=neg_num,
              p=p,
              q=q,
              filelist=filelist,
          )
      )
  
      node2vec_pyreader.start()
  
      exe = fluid.Executor(place)
      exe.run(startup_prog)
  
      prev_time = time.time()
      step = 0
  
      while 1:
          try:
              node2vec_loss_val = exe.run(
                  node2vec_prog,
                  fetch_list=[node2vec_loss],
                  return_numpy=True,
              )[0]
              cur_time = time.time()
              use_time = cur_time - prev_time
              prev_time = cur_time
              step += 1
              log.info(
                  "Step %d " % step
                  + "Node2vec Loss: %f " % node2vec_loss_val
                  + " %f s/step." % use_time
              )
          except fluid.core.EOFException:
              node2vec_pyreader.reset()
              break
  
      fluid.io.save_persistables(
          exe, os.path.join(save_path, "paddle_model"), node2vec_prog
      )
  
imports: import argparse
  import time
  import math
  import os
  import io
  from multiprocessing import Pool
  import glob
  import numpy
  import sklearn.metrics
  from sklearn.metrics import f1_score
  import pgl
  from pgl import data_loader
  from pgl.utils import op
  from pgl.utils.logger import log
  import paddle.fluid
  import paddle.fluid.layers
label_desc: Use image node_id 6 for calling a global function with example usage: main(args) without return types