code: def run_a_train_epoch(
      graph, node_idx, model, criterion, optimizer, evaluator
  ):
      model.train()
      logits = model(graph)[node_idx]
      labels = graph.ndata["labels"][node_idx]
      loss = criterion(logits, labels)
      optimizer.zero_grad()
      loss.backward()
      optimizer.step()
  
      loss = loss.data.item()
      labels = labels.cpu().numpy()
      preds = logits.cpu().detach().numpy()
  
      return (
          loss,
          evaluator.eval({"y_true": labels, "y_pred": preds})["rocauc"],
      )
  
file_path: dgl/examples/pytorch/ogb/ogbn-proteins/main_proteins_full_dgl.py
imports: import os
  import time
  import dgl.function
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from ogb.nodeproppred import Evaluator
  from ogb.nodeproppred.dataset_dgl import DglNodePropPredDataset
  from torch.optim import Adam
  from torch.optim.lr_scheduler import ReduceLROnPlateau
  from torch.utils.tensorboard import SummaryWriter
  from utils import load_model, set_random_seed
label_desc: Use image node_id 2 for calling a global function with example usage: run_a_train_epoch(graph, node_idx, model, criterion, optimizer, evaluator) and returns: loss,  evaluator