code: def train(model, data, epochs=200, lr=0.01, weight_decay=5e-4):
      model.train()
      optimizer = Adam(
          model.parameters(), lr=lr, weight_decay=weight_decay
      )
      for _ in range(epochs):
          optimizer.zero_grad()
          pred = model(data.x, data.edge_index, data.edge_weight)
          loss = F.cross_entropy(
              pred[data.train_mask], data.y[data.train_mask]
          )
          loss.backward()
          optimizer.step()
  
imports: import copy
  import os.path
  from typing import Optional
  import torch
  import torch.nn.functional
  from torch import Tensor
  from torch.optim import Adam
  import torch_geometric.transforms
  from torch_geometric.contrib.nn import GRBCDAttack, PRBCDAttack
  from torch_geometric.datasets import Planetoid
  from torch_geometric.nn import GATConv, GCNConv
  from torch_geometric.nn.conv.gcn_conv import gcn_norm
  from torch_geometric.utils import softmax
label_desc: Use image node_id 1 for calling a global function with example usage: train(model, data, epochs, lr, weight_decay) without return types