code: def test_evaluation_option(self):
      # Use a custom callback that asserts that we are running the
      # configured exact number of episodes per evaluation.
      config = (
          dqn.DQNConfig()
          .environment(env="CartPole-v1")
          .evaluation(
              evaluation_interval=2,
              evaluation_duration=2,
              evaluation_duration_unit="episodes",
              evaluation_config=dqn.DQNConfig.overrides(gamma=0.98),
          )
          .callbacks(callbacks_class=AssertEvalCallback)
      )
  
      for _ in framework_iterator(config, frameworks=("tf", "torch")):
          algo = config.build()
          # Given evaluation_interval=2, r0, r2, r4 should not contain
          # evaluation metrics, while r1, r3 should.
          r0 = algo.train()
          print(r0)
          r1 = algo.train()
          print(r1)
          r2 = algo.train()
          print(r2)
          r3 = algo.train()
          print(r3)
          algo.stop()
  
          self.assertFalse("evaluation" in r0)
          self.assertTrue("evaluation" in r1)
          self.assertFalse("evaluation" in r2)
          self.assertTrue("evaluation" in r3)
          self.assertTrue("episode_reward_mean" in r1["evaluation"])
          self.assertNotEqual(r1["evaluation"], r3["evaluation"])
  
imports: import gymnasium
  import numpy
  import os
  from pathlib import Path
  from random import choice
  import time
  import unittest
  import ray
  import ray.rllib.algorithms.dqn
  from ray.rllib.algorithms.bc import BCConfig
  import ray.rllib.algorithms.ppo
  from ray.rllib.examples.env.multi_agent import MultiAgentCartPole
  from ray.rllib.examples.parallel_evaluation_and_training import AssertEvalCallback
  from ray.rllib.utils.metrics.learner_info import LEARNER_INFO
  from ray.rllib.utils.test_utils import check, framework_iterator
label_desc: Use image node_id 4 for calling the TestAlgorithm obj's underlying member method code with example usage: obj.test_evaluation_option() without return types