code: def test_evaluate_policy():
      model = A2C("MlpPolicy", "Pendulum-v0", seed=0)
      n_steps_per_episode, n_eval_episodes = 200, 2
      model.n_callback_calls = 0
  
      def dummy_callback(locals_, _globals):
          locals_["model"].n_callback_calls += 1
  
      _, episode_lengths = evaluate_policy(
          model,
          model.get_env(),
          n_eval_episodes,
          deterministic=True,
          render=False,
          callback=dummy_callback,
          reward_threshold=None,
          return_episode_rewards=True,
      )
  
      n_steps = sum(episode_lengths)
      assert n_steps == n_steps_per_episode * n_eval_episodes
      assert n_steps == model.n_callback_calls
  
      # Reaching a mean reward of zero is impossible with the Pendulum env
      with pytest.raises(AssertionError):
          evaluate_policy(
              model,
              model.get_env(),
              n_eval_episodes,
              reward_threshold=0.0,
          )
  
      episode_rewards, _ = evaluate_policy(
          model,
          model.get_env(),
          n_eval_episodes,
          return_episode_rewards=True,
      )
      assert len(episode_rewards) == n_eval_episodes
  
file_path: stable-baselines/tests/test_utils.py
imports: import os
  import shutil
  import pytest
  import gym
  from stable_baselines import A2C
  from stable_baselines.bench.monitor import Monitor
  from stable_baselines.common.evaluation import evaluate_policy
  from stable_baselines.common.cmd_util import make_vec_env
  from stable_baselines.common.vec_env import DummyVecEnv, SubprocVecEnv
label_desc: Use image node_id 3 for calling a global function with example usage: test_evaluate_policy() without return types