code: def train(
      train_loader,
      val_loader,
      test_loader,
      args,
      num_node_features,
      num_classes,
      device="cpu",
  ):
      model_cls = GNN
  
      model = model_cls(
          num_node_features, args.hidden_dim, num_classes, args
      ).to(device)
      opt = build_optimizer(args, model.parameters())
  
      for epoch in range(args.epochs):
          total_loss = 0
          model.train()
          for batch in train_loader:
              batch.to(device)
              opt.zero_grad()
              pred = model(batch)
              label = batch.node_label
              loss = model.loss(pred[batch.node_label_index], label)
              total_loss += loss.item()
              loss.backward()
              opt.step()
  
          train_acc = test(train_loader, model, device)
          val_acc = test(val_loader, model, device)
          test_acc = test(test_loader, model, device)
          print(
              "Epoch {}: Train: {:.4f}, Validation: {:.4f}. Test: {:.4f}, Loss: {:.4f}".format(
                  epoch + 1, train_acc, val_acc, test_acc, total_loss
              )
          )
  
imports: import torch
  import argparse
  import numpy
  import torch.nn
  import torch.nn.functional
  import torch_geometric.transforms
  import torch_geometric.nn
  import torch.optim
  from torch.utils.data import DataLoader
  from torch_geometric.datasets import Planetoid
  from sklearn.metrics import *
  from torch.nn import Sequential, Linear, ReLU
  from deepsnap.dataset import GraphDataset
  from deepsnap.batch import Batch
label_desc: Use image node_id 3 for calling a global function with example usage: train(train_loader, val_loader, test_loader, args, num_node_features, num_classes, device) without return types