code: def train(model, dataloaders, optimizer, args):
      val_max = 0
      best_model = model
      t_accu = []
      v_accu = []
      e_accu = []
      for epoch in range(1, args.epochs + 1):
          for iter_i, batch in enumerate(dataloaders["train"]):
              batch.to(args.device)
              model.train()
              optimizer.zero_grad()
              pred = model(batch)
              loss = model.loss(pred, batch.edge_label)
              loss.backward()
              optimizer.step()
  
              log = "Epoch: {:03d}, Train loss: {:.4f}, Train: {:.4f}, Val: {:.4f}, Test: {:.4f}"
              accs = test(model, dataloaders, args)
              t_accu.append(accs["train"])
              v_accu.append(accs["val"])
              e_accu.append(accs["test"])
  
              print(
                  log.format(
                      epoch,
                      loss.item(),
                      accs["train"],
                      accs["val"],
                      accs["test"],
                  )
              )
              if val_max < accs["val"]:
                  val_max = accs["val"]
                  best_model = copy.deepcopy(model)
  
      log = "Best: Train: {:.4f}, Val: {:.4f}, Test: {:.4f}"
      accs = test(best_model, dataloaders, args)
      print(log.format(accs["train"], accs["val"], accs["test"]))
  
      return t_accu, v_accu, e_accu
  
imports: import argparse
  import copy
  import time
  import numpy
  import networkx
  import sklearn.metrics
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.utils.data import DataLoader
  from torch_geometric.datasets import Planetoid
  from torch_geometric.datasets import TUDataset
  import torch_geometric.transforms
  import torch_geometric.nn
  from deepsnap.hetero_graph import HeteroGraph
  from deepsnap.dataset import GraphDataset
  from deepsnap.batch import Batch
  from deepsnap.hetero_gnn import HeteroSAGEConv, HeteroConv, forward_op
label_desc: Use image node_id 4 for calling a global function with example usage: train(model, dataloaders, optimizer, args) and returns: t_accu,  v_accu,  e_accu