code: def build_optimizer(args, params):
      weight_decay = args.weight_decay
      filter_fn = filter(lambda p: p.requires_grad, params)
      if args.opt == "adam":
          optimizer = optim.Adam(
              filter_fn, lr=args.lr, weight_decay=weight_decay
          )
      elif args.opt == "sgd":
          optimizer = optim.SGD(
              filter_fn,
              lr=args.lr,
              momentum=0.95,
              weight_decay=weight_decay,
          )
      elif args.opt == "rmsprop":
          optimizer = optim.RMSprop(
              filter_fn, lr=args.lr, weight_decay=weight_decay
          )
      elif args.opt == "adagrad":
          optimizer = optim.Adagrad(
              filter_fn, lr=args.lr, weight_decay=weight_decay
          )
      return optimizer
  
imports: import torch
  import argparse
  import numpy
  import torch.nn
  import torch.nn.functional
  import torch_geometric.transforms
  import torch_geometric.nn
  import torch.optim
  from torch.utils.data import DataLoader
  from torch_geometric.datasets import Planetoid
  from sklearn.metrics import *
  from torch.nn import Sequential, Linear, ReLU
  from deepsnap.dataset import GraphDataset
  from deepsnap.batch import Batch
label_desc: Use image node_id 2 for calling a global function with example usage: build_optimizer(args, params) and returns: optimizer