code: def test_episode(self):
      env = ale.ALE("breakout")
      self.assertFalse(env.is_terminal)
      last_state = env.state
      while not env.is_terminal:
          # test state
          self.assertEqual(len(env.state), 4)
          for s in env.state:
              self.assertEqual(s.shape, (84, 84))
              self.assertEqual(s.dtype, np.uint8)
  
          print("state (sum)", sum(env.state).sum())
  
          legal_actions = env.legal_actions
          print("legal_actions:", legal_actions)
          self.assertGreater(len(legal_actions), 0)
          a = random.randrange(len(legal_actions))
          print("a", a)
          env.receive_action(a)
          if not env.is_terminal:
              np.testing.assert_array_equal(
                  np.asarray(last_state[1:]), np.asarray(env.state[:3])
              )
          last_state = env.state
  
file_path: chainerrl/tests/test_ale.py
imports: import random
  import sys
  import tempfile
  import unittest
  import numpy
  from PIL import Image
  from chainerrl.envs import ale
label_desc: Use image node_id 3 for calling the TestALE obj's underlying member method code with example usage: obj.test_episode() without return types