code: def optimizer(name):
      """Get pre-registered optimizer keyed by name.
  
      `name` should be snake case, though SGD -> sgd, RMSProp -> rms_prop and
      UpperCamelCase -> snake_case conversions included for legacy support.
  
      Args:
        name: name of optimizer used in registration. This should be a snake case
          identifier, though others supported for legacy reasons.
  
      Returns:
        optimizer
      """
      warn_msg = (
          "Please update `registry.optimizer` callsite "
          "(likely due to a `HParams.optimizer` value)"
      )
      if name == "SGD":
          name = "sgd"
          tf.logging.warning(
              "'SGD' optimizer now keyed by 'sgd'. %s" % warn_msg
          )
      elif name == "RMSProp":
          name = "rms_prop"
          tf.logging.warning(
              "'RMSProp' optimizer now keyed by 'rms_prop'. %s"
              % warn_msg
          )
      else:
          snake_name = misc_utils.camelcase_to_snakecase(name)
          if name != snake_name:
              tf.logging.warning(
                  "optimizer names now keyed by snake_case names. %s"
                  % warn_msg
              )
              name = snake_name
      return Registries.optimizers[name]
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  from tensor2tensor.utils import misc_utils
  import tensorflow.compat.v1
  from tensorflow.python.util import tf_inspect
label_desc: Use image node_id 10 for calling a global function with example usage: optimizer(name) and returns: Registries