code: def train(model, data, A_list, X, label):
      dev = X.device
      train_idx = (
          torch.from_numpy(data["train_idx"]).long().squeeze(0).to(dev)
      )
      val_idx = (
          torch.from_numpy(data["val_idx"]).long().squeeze(0).to(dev)
      )
      test_idx = (
          torch.from_numpy(data["test_idx"]).long().squeeze(0).to(dev)
      )
      optimizer = Adam(model.parameters(), lr=0.005, weight_decay=0.001)
  
      for epoch in range(70):
          # Forward.
          model.train()
          logits = model(A_list, X)
  
          # Compute loss with nodes in training set.
          loss = F.cross_entropy(logits[train_idx], label[train_idx])
  
          # Backward.
          optimizer.zero_grad()
          loss.backward()
          optimizer.step()
  
          # Compute prediction.
          model.eval()
          logits = model(A_list, X)
          pred = logits.argmax(dim=1)
  
          # Evaluate the prediction.
          val_acc, test_acc = evaluate(label, val_idx, test_idx, pred)
          print(
              f"In epoch {epoch}, loss: {loss:.3f}, val acc: {val_acc:.3f}, test"
              f" acc: {test_acc:.3f}"
          )
  
imports: import pickle
  import dgl.sparse
  import torch
  import torch.nn
  import torch.nn.functional
  from dgl.data.utils import _get_dgl_url, download, get_download_dir
  from torch.optim import Adam
label_desc: Use image node_id 2 for calling a global function with example usage: train(model, data, A_list, X, label) without return types