code: def get_optimizer_def(optimizer_str, learning_rate_fn):
      """Get optimizer for adversarial attack."""
      optimizer_config = ml_collections.ConfigDict()
      if optimizer_str == "GradientDescent":
          optimizer_config.optimizer = "sgd"
      elif optimizer_str == "Adam":
          optimizer_config.optimizer = "adam"
          optimizer_config.b1 = 0.5
          optimizer_config.b2 = 0.5
      elif optimizer_str == "AdaBelief":
          optimizer_config.optimizer = "adabelief"
          optimizer_config.b1 = 0.5
          optimizer_config.b2 = 0.5
      else:
          raise NotImplementedError(
              "advprop.optimizer is not valid: %s" % optimizer_str
          )
      return functools.partial(
          optimizers.get_optimizer,
          optimizer_config=optimizer_config,
          learning_rate_fn=learning_rate_fn,
      )
  
file_path: scenic/scenic/projects/adversarialtraining/attacks/attack_compute.py
imports: import functools
  import jax
  import jax.numpy
  import ml_collections
  from scenic.projects.adversarialtraining.attacks import attack_losses
  from scenic.projects.adversarialtraining.attacks import attack_methods
  from scenic.projects.adversarialtraining.attacks import attack_transforms
  from scenic.train_lib import lr_schedules
  from scenic.train_lib import optimizers
label_desc: Use image node_id 4 for calling a global function with example usage: get_optimizer_def(optimizer_str, learning_rate_fn) and returns: functools