code: def get_optimizer(name: str = "Adam") -> Type[torch.optim.Optimizer]:
      """
      Get an optimizer class from its name.
  
      Parameters
      ----------
      name
          Name of the optimizer.
  
      Returns
      -------
      The optimizer class.
      """
      optimizer = getattr(torch.optim, name, None)
  
      if optimizer is None:
          raise NotImplementedError(
              f"Optimizer {name} not implemented."
          )
  
      return optimizer
  
imports: import logging
  from typing import Type
  from alibi_detect.utils._types import TorchDeviceType
  import torch
label_desc: Use image node_id 4 for calling a global function with example usage: get_optimizer(name) and returns: optimizer