code: def train_model(data, model, loss_func, optimizer, device, g_data):
      model.train()
      out = model(g_data)
  
      loss = get_loss(
          "train", data, out, loss_func, device, get_auc=False
      )
  
      optimizer.zero_grad()
      loss.backward()
      optimizer.step()
      optimizer.zero_grad()
  
      return g_data
  
file_path: dgl/examples/pytorch/P-GNN/main.py
imports: import os
  import warnings
  import dgl
  import numpy
  import torch
  import torch.nn
  from model import PGNN
  from sklearn.metrics import roc_auc_score
  from utils import get_dataset, preselect_anchor
label_desc: Use image node_id 2 for calling a global function with example usage: train_model(data, model, loss_func, optimizer, device, g_data) and returns: g_data