code: def _get_adam_optimizer(learning_rate):
      if tf.__internal__.tf2.enabled():
          return tf_keras.optimizers.Adam(learning_rate=learning_rate)
      return tf_keras.optimizers.legacy.Adam(
          learning_rate=learning_rate
      )
  
imports: import collections
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python import optimizer
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.internal import tf_keras
  from tensorflow_probability.python.math.minimize import minimize
  from tensorflow_probability.python.math.minimize import minimize_stateless
label_desc: Use image node_id 1 for calling a global function with example usage: _get_adam_optimizer(learning_rate) and returns: tf_keras, tf_keras