code: def get_learning_rate(optimizer):
      """Gets the current learning rate from an optimizer to be graphed."""
      # Keras optimizers uses `learning_rate`.
      if hasattr(optimizer, "learning_rate"):
          learning_rate = (
              optimizer.learning_rate
          )  # pylint: disable=protected-access
      # Adam optimizers store their learning rate in `_lr`.
      elif hasattr(optimizer, "_lr"):
          if callable(
              optimizer._lr
          ):  # pylint: disable=protected-access
              learning_rate = (
                  optimizer._lr()
              )  # pylint: disable=protected-access
          else:
              learning_rate = (
                  optimizer._lr
              )  # pylint: disable=protected-access
      # Non Adam optimizers store their learning rate in `_learning_rate`.
      elif hasattr(optimizer, "_learning_rate"):
          if callable(
              optimizer._learning_rate
          ):  # pylint: disable=protected-access
              learning_rate = (
                  optimizer._learning_rate()
              )  # pylint: disable=protected-access
          else:
              learning_rate = (
                  optimizer._learning_rate
              )  # pylint: disable=protected-access
      else:
          # -1 is returned when the learning rate cannot be inferred.
          return -1
  
      return learning_rate
  
file_path: agents/tf_agents/agents/ppo/ppo_utils.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Sequence
  import tensorflow
  import tensorflow_probability
  from tf_agents.distributions import utils
  from tf_agents.specs import distribution_spec
  from tf_agents.trajectories import policy_step
  from tf_agents.trajectories import time_step
  from tf_agents.trajectories import trajectory
  from tf_agents.typing import types
  from tf_agents.utils import nest_utils
label_desc: Use image node_id 7 for calling a global function with example usage: get_learning_rate(optimizer) and returns: learning_rate, unknown