code: def run_main(args):
      cfg = load_config(args.config)
      if args.gpu is not None:
          cfg.resource.gpus = range(args.gpu)
      if args.cpu is not None:
          cfg.resource.cpu_per_gpu = args.cpu
      if args.epoch is not None:
          cfg.train.num_epoch = args.epoch
  
      app = gap.Application(cfg.application, **cfg.resource)
      if "format" in cfg:
          app.set_format(**cfg.format)
      app.load(**cfg.graph)
      app.build(**cfg.build)
      if "load" in cfg:
          app.load_model(**cfg.load)
      app.train(**cfg.train)
      if args.eval and "evaluate" in cfg:
          if isinstance(cfg.evaluate, dict):
              cfg.evaluate = [cfg.evaluate]
          for evaluation in cfg.evaluate:
              app.evaluate(**evaluation)
      if "save" in cfg:
          app.save_model(**cfg.save)
  
imports: from __future__ import print_function, absolute_import
  import os
  import re
  import glob
  import yaml
  import shutil
  import logging
  import argparse
  from easydict import EasyDict
  import numpy
  import graphvite
  import graphvite.application
label_desc: Use image node_id 5 for calling a global function with example usage: run_main(args) without return types