code: def test_action_repeats_obey_end_of_episode(self):
      action_repeat = 7
      total_steps = 10
      step_return_values = [
          _MID_TIMESTEP for _ in range(total_steps - 1)
      ]
      step_return_values.append(LAST_TIMESTEP)
  
      control_env = self.create_env()
      control_env.step = mock.MagicMock(side_effect=step_return_values)
  
      gym_env = deepmind_control_lib.DeepmindControlPreprocessing(
          control_env, action_repeat=action_repeat
      )
      gym_env.reset()
  
      gym_env.step(gym_env.action_space.sample())
      is_game_over_step1 = gym_env.game_over
  
      gym_env.step(gym_env.action_space.sample())
      is_game_over_step2 = gym_env.game_over
  
      self.assertFalse(is_game_over_step1)
      self.assertTrue(is_game_over_step2)
      self.assertEqual(control_env.step.call_count, total_steps)
  
imports: import collections
  from typing import Callable, Mapping
  from unittest import mock
  from absl.testing import absltest
  from absl.testing import parameterized
  from dm_control import suite
  from dm_control.rl import control
  import dm_env
  from dm_env import specs
  from dopamine.labs.sac_from_pixels import deepmind_control_lib
  import numpy
label_desc: Use image node_id 8 for calling the DeepmindControlLibTest obj's underlying member method code with example usage: obj.test_action_repeats_obey_end_of_episode() without return types