code: def get_optimizer(
      optimizer_name, parameters, lr, momentum=0, weight_decay=0
  ):
      if optimizer_name == "sgd":
          return optim.SGD(
              parameters,
              lr,
              momentum=momentum,
              weight_decay=weight_decay,
          )
      elif optimizer_name == "nesterov_sgd":
          return optim.SGD(
              parameters,
              lr,
              momentum=momentum,
              weight_decay=weight_decay,
              nesterov=True,
          )
      elif optimizer_name == "rmsprop":
          return optim.RMSprop(
              parameters,
              lr=lr,
              momentum=momentum,
              weight_decay=weight_decay,
          )
      elif optimizer_name == "adagrad":
          return optim.Adagrad(
              parameters, lr=lr, weight_decay=weight_decay
          )
      elif optimizer_name == "adam":
          return optim.AdamW(
              parameters, lr=lr, weight_decay=weight_decay
          )
  
imports: import collections
  import torch
  from torch import Tensor
  import torch.nn
  import torch.backends.cudnn
  import subprocess
  import os
  import time
  import shutil
  from datetime import datetime
  import torch.optim
  from torch.optim import lr_scheduler
  import sys
  import models
  import numpy
  import torch.nn
  import math
label_desc: Use image node_id 3 for calling a global function with example usage: get_optimizer(optimizer_name, parameters, lr, momentum, weight_decay) and returns: optim, optim, optim, optim, optim