docstr: :param level: The environment level. Each environment can have multiple levels
  :param seed: a seed for the random number generator of the environment
  :param frame_skip: number of frames to skip (while repeating the same action) between each two agent directives
  :param human_control: human should control the environment
  :param visualization_parameters: a blob of parameters used for visualization of the environment
  :param **kwargs: as the class is instantiated by EnvironmentParameters, this is used to support having
                   additional arguments which will be ignored by this class, but might be used by others
code: def __init__(
      self,
      level: LevelSelection,
      seed: int,
      frame_skip: int,
      human_control: bool,
      custom_reward_threshold: Union[int, float],
      visualization_parameters: VisualizationParameters,
      target_success_rate: float = 1.0,
      **kwargs,
  ):
      """
      :param level: The environment level. Each environment can have multiple levels
      :param seed: a seed for the random number generator of the environment
      :param frame_skip: number of frames to skip (while repeating the same action) between each two agent directives
      :param human_control: human should control the environment
      :param visualization_parameters: a blob of parameters used for visualization of the environment
      :param **kwargs: as the class is instantiated by EnvironmentParameters, this is used to support having
                       additional arguments which will be ignored by this class, but might be used by others
      """
      super().__init__()
  
      # env initialization
  
      self.game = []
  
      self.state = {}
      self.observation = None
      self.goal = None
      self.reward = 0
      self.done = False
      self.info = {}
      self._last_env_response = None
      self.last_action = 0
      self.episode_idx = 0
      self.total_steps_counter = 0
      self.current_episode_steps_counter = 0
      self.last_episode_time = time.time()
      self.key_to_action = {}
      self.last_episode_images = []
  
      # rewards
      self.total_reward_in_current_episode = 0
      self.max_reward_achieved = -np.inf
      self.reward_success_threshold = custom_reward_threshold
  
      # spaces
      self.state_space = self._state_space = None
      self.goal_space = self._goal_space = None
      self.action_space = self._action_space = None
      self.reward_space = RewardSpace(
          1, reward_success_threshold=self.reward_success_threshold
      )  # TODO: add a getter and setter
  
      self.env_id = str(level)
      self.seed = seed
      self.frame_skip = frame_skip
  
      # human interaction and visualization
      self.human_control = human_control
      self.wait_for_explicit_human_action = False
      self.is_rendered = (
          visualization_parameters.render or self.human_control
      )
      self.native_rendering = (
          visualization_parameters.native_rendering
          and not self.human_control
      )
      self.visualization_parameters = visualization_parameters
      if not self.native_rendering:
          self.renderer = Renderer()
  
      # Set target reward and target_success if present
      self.target_success_rate = target_success_rate
  
imports: import operator
  import time
  from collections import OrderedDict
  from typing import Union, List, Tuple, Dict
  import numpy
  from rl_coach import logger
  from rl_coach.base_parameters import Parameters
  from rl_coach.base_parameters import VisualizationParameters
  from rl_coach.core_types import GoalType, ActionType, EnvResponse, RunPhase
  from rl_coach.environments.environment_interface import EnvironmentInterface
  from rl_coach.logger import screen
  from rl_coach.renderer import Renderer
  from rl_coach.spaces import ActionSpace, ObservationSpace, DiscreteActionSpace, RewardSpace, StateSpace
  from rl_coach.utils import squeeze_list, force_list
label_desc: Use image node_id 1 to create a new Environment object from inherited base classes: EnvironmentInterface with example: obj = Environment(level, seed, frame_skip, human_control, custom_reward_threshold, visualization_parameters, target_success_rate)