code: def make_optimizer(hparams, lr):
      if hparams.optimizer == "SGD":
          return SgdOptimizer(lr)
      elif hparams.optimizer == "Adafactor":
          return adafactor_optimizer_from_hparams(hparams, lr)
      else:
          raise ValueError("Unknown Optimizer")
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import re
  import gin
  from mesh_tensorflow import layers
  from mesh_tensorflow import ops_with_redefined_builtins
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling a global function with example usage: make_optimizer(hparams, lr) and returns: SgdOptimizer, adafactor_optimizer_from_hparams