code: def main(args):
      """main"""
      device_ids = get_cuda_places()
      place = paddle.CUDAPlace(device_ids[0])
      exe = static.Executor(place)
      if paddle.distributed.get_world_size() > 1:
          fleet.init(is_collective=True)
      else:
          fleet.init()
  
      # multi node save model path add rank id
      if paddle.distributed.get_world_size() > 1:
          worker_id = "%03d" % (fleet.worker_index())
          args.local_model_path = os.path.join(
              args.local_model_path, worker_id
          )
          args.local_result_path = os.path.join(
              args.local_result_path, worker_id
          )
          args.local_dump_path = os.path.join(
              args.local_dump_path, worker_id
          )
          print("args=%s" % (args))
      need_inference = args.need_inference
      infer_model_dict = None
      startup_program = static.Program()
      train_program = static.Program()
  
      print(
          "workid={}, work num={}, node num={}, worker_endpoints={}".format(
              fleet.worker_index(),
              fleet.worker_num(),
              fleet.node_num(),
              fleet.worker_endpoints(True),
          )
      )
  
      with static.program_guard(train_program, startup_program):
          with paddle.utils.unique_name.guard():
              model_dict = getattr(M, args.model_type)(config=args)
  
      model_dict.startup_program = startup_program
      model_dict.train_program = train_program
  
      adam = paddle.optimizer.Adam(learning_rate=args.dense_lr)
      optimizer = fleet.distributed_optimizer(
          adam, strategy=get_strategy(args, model_dict)
      )
      optimizer.minimize(model_dict.loss, model_dict.startup_program)
      make_distributed_train_program(args, model_dict)
  
      if need_inference:
          infer_startup_program = static.Program()
          infer_train_program = static.Program()
  
          with static.program_guard(
              infer_train_program, infer_startup_program
          ):
              with paddle.utils.unique_name.guard():
                  infer_model_dict = getattr(M, args.model_type)(
                      config=args, is_predict=True
                  )
  
          infer_model_dict.startup_program = infer_startup_program
          infer_model_dict.train_program = infer_train_program
  
          fake_lr_infer = 0.00
          adam_infer = paddle.optimizer.Adam(
              learning_rate=fake_lr_infer
          )
          optimizer1 = fleet.distributed_optimizer(
              adam_infer, strategy=get_strategy(args, infer_model_dict)
          )
          optimizer1.minimize(
              infer_model_dict.loss, infer_model_dict.startup_program
          )
          make_distributed_infer_program(args, infer_model_dict)
  
      # init and run server or worker
      if fleet.is_server():
          log.info("before run server")
          fleet.init_server()
          fleet.run_server()
  
      elif fleet.is_worker():
          ret = run_worker(args, exe, model_dict, infer_model_dict)
          if ret != 0:
              exe.close()
              fleet.stop_worker()
              return -1
      exe.close()
      fleet.stop_worker()
      return 0
  
imports: import paddle
  import os
  import sys
  import time
  import glob
  import yaml
  import shutil
  import argparse
  import traceback
  import pickle
  import numpy
  import helper
  from datetime import datetime
  import paddle
  import paddle.fluid
  import paddle.static
  from place import get_cuda_places
  from pgl.utils.logger import log
  from datetime import datetime
  from config_fleet import get_strategy
  import util
  import models
  from paddle.distributed import fleet
  from embedding import DistEmbedding
  from graph import DistGraph
  from dataset import UnsupReprLearningDataset, InferDataset
  from distributed_program import make_distributed_train_program, make_distributed_infer_program
  from util_config import prepare_config, pretty
  import util_hadoop
label_desc: Use image node_id 5 for calling a global function with example usage: main(args) and returns: int, unknown