code: def choose_optimizer(optimizer_name, bounds):
      """
      Selects the type of local optimizer
      """
      if optimizer_name == "lbfgs":
          optimizer = OptLbfgs(bounds)
  
      elif optimizer_name == "DIRECT":
          optimizer = OptDirect(bounds)
  
      elif optimizer_name == "CMA":
          optimizer = OptCma(bounds)
      else:
          raise InvalidVariableNameError("Invalid optimizer selected.")
  
      return optimizer
  
imports: import numpy
  from ..core.errors import InvalidVariableNameError
label_desc: Use image node_id 2 for calling a global function with example usage: choose_optimizer(optimizer_name, bounds) and returns: optimizer