code: def test_kl_coeff_changes(self):
      # Simple environment with 4 independent cartpole entities
      register_env(
          "multi_agent_cartpole",
          lambda _: MultiAgentCartPole({"num_agents": 2}),
      )
  
      initial_kl_coeff = 0.01
      config = (
          ppo.PPOConfig()
          .experimental(_enable_new_api_stack=True)
          .environment("CartPole-v1")
          .rollouts(
              num_rollout_workers=0,
              rollout_fragment_length=50,
          )
          .training(
              gamma=0.99,
              model=dict(
                  fcnet_hiddens=[10, 10],
                  fcnet_activation="linear",
                  vf_share_layers=False,
              ),
              kl_coeff=initial_kl_coeff,
          )
          .exploration(exploration_config={})
          .environment("multi_agent_cartpole")
          .multi_agent(
              policies={"p0", "p1"},
              policy_mapping_fn=lambda agent_id, episode, worker, **kwargs: (
                  "p{}".format(agent_id % 2)
              ),
          )
      )
  
      for _ in framework_iterator(config, ("torch", "tf2")):
          algo = config.build()
          # Call train while results aren't returned because this is
          # a asynchronous Algorithm and results are returned asynchronously.
          curr_kl_coeff_1 = None
          curr_kl_coeff_2 = None
          while not curr_kl_coeff_1 or not curr_kl_coeff_2:
              results = algo.train()
  
              # Attempt to get the current KL coefficient from the learner.
              # Iterate until we have found both coefficients at least once.
              if (
                  results
                  and "info" in results
                  and LEARNER_INFO in results["info"]
              ):
                  if "p0" in results["info"][LEARNER_INFO]:
                      curr_kl_coeff_1 = results["info"][LEARNER_INFO][
                          "p0"
                      ][LEARNER_RESULTS_CURR_KL_COEFF_KEY]
                  if "p1" in results["info"][LEARNER_INFO]:
                      curr_kl_coeff_2 = results["info"][LEARNER_INFO][
                          "p1"
                      ][LEARNER_RESULTS_CURR_KL_COEFF_KEY]
  
          self.assertNotEqual(curr_kl_coeff_1, initial_kl_coeff)
          self.assertNotEqual(curr_kl_coeff_2, initial_kl_coeff)
  
imports: import unittest
  import tempfile
  import gymnasium
  import numpy
  import tensorflow
  import torch
  import tree
  import ray
  import ray.rllib.algorithms.ppo
  from ray.rllib.algorithms.ppo.ppo import LEARNER_RESULTS_CURR_KL_COEFF_KEY
  from ray.rllib.examples.env.multi_agent import MultiAgentCartPole
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.tune.registry import register_env
  from ray.rllib.utils.metrics.learner_info import LEARNER_INFO
  from ray.rllib.utils.test_utils import check, framework_iterator
  from ray.rllib.evaluation.postprocessing import compute_gae_for_sample_batch
label_desc: Use image node_id 5 for calling the TestPPO obj's underlying member method code with example usage: obj.test_kl_coeff_changes() without return types