docstr: env wrapper for test and validation in atari environment.
  
  Args:
      env (ClipRewardEnv or FrameStack): the atari env
      test_episodes (int): number of episodes for evaluation
docstr_tok: ["env","wrapper","for","test","and","validation","in","atari","environment",".","Args",":","env","(","ClipRewardEnv","or","FrameStack",")",":","the","atari","env","test_episodes","(","int",")",":","number","of","episodes","for","evaluation"]
code: def __init__(self, env, test_episodes=3):
      """env wrapper for test and validation in atari environment.
  
      Args:
          env (ClipRewardEnv or FrameStack): the atari env
          test_episodes (int): number of episodes for evaluation
      """
  
      gym.Wrapper.__init__(self, env)
      self._env = env
      self._monitor = get_wrapper_by_cls(env, MonitorEnv)
      self._test_episodes = test_episodes
      self._was_real_done = False
      self._eval_rewards = None
      self._end_episode = (
          len(self._monitor.get_episode_rewards()) + test_episodes
      )
  
imports: import time
  import numpy
  from collections import deque
  import gym
  from gym import spaces
  from parl.env.compat_wrappers import CompatWrapper, is_gym_version_ge, V_NPRANDOM_CHANGED
  import cv2
label_desc: Use image node_id 1 to create a new TestEnv object from inherited base classes: gym with example: obj = TestEnv(env, test_episodes)