code: def test_impala_lr_schedule(self):
      # Test whether we correctly ignore the "lr" setting.
      # The first lr should be 0.05.
      config = (
          impala.ImpalaConfig()
          .resources(num_gpus=0)
          .training(
              lr=0.1,
              lr_schedule=[
                  [0, 0.05],
                  [100000, 0.000001],
              ],
              train_batch_size=100,
          )
          .rollouts(num_envs_per_worker=2)
          .environment(env="CartPole-v1")
      )
  
      def get_lr(result):
          return result["info"][LEARNER_INFO][DEFAULT_POLICY_ID][
              LEARNER_STATS_KEY
          ]["cur_lr"]
  
      for fw in framework_iterator(config):
          algo = config.build()
          policy = algo.get_policy()
  
          try:
              if fw == "tf":
                  check(policy.get_session().run(policy.cur_lr), 0.05)
              else:
                  check(policy.cur_lr, 0.05)
              for _ in range(1):
                  r1 = algo.train()
              for _ in range(2):
                  r2 = algo.train()
              for _ in range(2):
                  r3 = algo.train()
              # Due to the asynch'ness of IMPALA, learner-stats metrics
              # could be delayed by one iteration. Do 3 train() calls here
              # and measure guaranteed decrease in lr between 1st and 3rd.
              lr1 = get_lr(r1)
              lr2 = get_lr(r2)
              lr3 = get_lr(r3)
              assert lr2 <= lr1, (lr1, lr2)
              assert lr3 <= lr2, (lr2, lr3)
              assert lr3 < lr1, (lr1, lr3)
          finally:
              algo.stop()
  
file_path: ray/python/ray/rllib/algorithms/impala/tests/test_impala.py
imports: import unittest
  import ray
  import ray.rllib.algorithms.impala
  from ray.rllib.policy.sample_batch import DEFAULT_POLICY_ID
  from ray.rllib.utils.framework import try_import_tf
  from ray.rllib.utils.metrics.learner_info import LEARNER_INFO, LEARNER_STATS_KEY
  from ray.rllib.utils.test_utils import check, check_compute_single_action, check_train_results, framework_iterator
label_desc: Use image node_id 4 for calling the TestIMPALA obj's underlying member method code with example usage: obj.test_impala_lr_schedule() and returns: result