code: def optimizer_example(params):
      if cfg.optim.optimizer == "adagrad":
          optimizer = optim.Adagrad(
              params,
              lr=cfg.optim.base_lr,
              weight_decay=cfg.optim.weight_decay,
          )
          return optimizer
  
imports: import torch.optim
  from graphgym.config import cfg
  from graphgym.register import register_optimizer, register_scheduler
label_desc: Use image node_id 1 for calling a global function with example usage: optimizer_example(params) and returns: optimizer