code: def main():
      global device, in_feats, n_classes
  
      argparser = argparse.ArgumentParser(
          "GCN on OGBN-Arxiv",
          formatter_class=argparse.ArgumentDefaultsHelpFormatter,
      )
      argparser.add_argument(
          "--cpu",
          action="store_true",
          help="CPU mode. This option overrides --gpu.",
      )
      argparser.add_argument(
          "--gpu", type=int, default=0, help="GPU device ID."
      )
      argparser.add_argument(
          "--n-runs", type=int, default=10, help="running times"
      )
      argparser.add_argument(
          "--n-epochs", type=int, default=1000, help="number of epochs"
      )
      argparser.add_argument(
          "--use-labels",
          action="store_true",
          help="Use labels in the training set as input features.",
      )
      argparser.add_argument(
          "--use-linear", action="store_true", help="Use linear layer."
      )
      argparser.add_argument(
          "--lr", type=float, default=0.005, help="learning rate"
      )
      argparser.add_argument(
          "--n-layers", type=int, default=3, help="number of layers"
      )
      argparser.add_argument(
          "--n-hidden",
          type=int,
          default=256,
          help="number of hidden units",
      )
      argparser.add_argument(
          "--dropout", type=float, default=0.5, help="dropout rate"
      )
      argparser.add_argument(
          "--wd", type=float, default=0, help="weight decay"
      )
      argparser.add_argument(
          "--log-every",
          type=int,
          default=20,
          help="log every LOG_EVERY epochs",
      )
      argparser.add_argument(
          "--plot-curves",
          action="store_true",
          help="plot learning curves",
      )
      args = argparser.parse_args()
  
      if args.cpu:
          device = th.device("cpu")
      else:
          device = th.device("cuda:%d" % args.gpu)
  
      # load data
      data = DglNodePropPredDataset(name="ogbn-arxiv")
      evaluator = Evaluator(name="ogbn-arxiv")
  
      splitted_idx = data.get_idx_split()
      train_idx, val_idx, test_idx = (
          splitted_idx["train"],
          splitted_idx["valid"],
          splitted_idx["test"],
      )
      graph, labels = data[0]
  
      # add reverse edges
      srcs, dsts = graph.all_edges()
      graph.add_edges(dsts, srcs)
  
      # add self-loop
      print(f"Total edges before adding self-loop {graph.num_edges()}")
      graph = graph.remove_self_loop().add_self_loop()
      print(f"Total edges after adding self-loop {graph.num_edges()}")
  
      in_feats = graph.ndata["feat"].shape[1]
      n_classes = (labels.max() + 1).item()
      graph.create_formats_()
  
      train_idx = train_idx.to(device)
      val_idx = val_idx.to(device)
      test_idx = test_idx.to(device)
      labels = labels.to(device)
      graph = graph.to(device)
  
      # run
      val_accs = []
      test_accs = []
  
      for i in range(args.n_runs):
          val_acc, test_acc = run(
              args,
              graph,
              labels,
              train_idx,
              val_idx,
              test_idx,
              evaluator,
              i,
          )
          val_accs.append(val_acc)
          test_accs.append(test_acc)
  
      print(f"Runned {args.n_runs} times")
      print("Val Accs:", val_accs)
      print("Test Accs:", test_accs)
      print(
          f"Average val accuracy: {np.mean(val_accs)} ± {np.std(val_accs)}"
      )
      print(
          f"Average test accuracy: {np.mean(test_accs)} ± {np.std(test_accs)}"
      )
      print(f"Number of params: {count_parameters(args)}")
  
imports: import argparse
  import math
  import time
  import numpy
  import torch
  import torch.nn.functional
  import torch.optim
  from matplotlib import pyplot
  from matplotlib.ticker import AutoMinorLocator, MultipleLocator
  from models import GCN
  from ogb.nodeproppred import DglNodePropPredDataset, Evaluator
label_desc: Use image node_id 10 for calling a global function with example usage: main() without return types