class_docstr: Wraps a Gym environment into a maze core environment.
  
  :param env: The Gym environment.
docstr: implementation of :class:`~maze.core.env.simulated_env_mixin.SimulatedEnvMixin`.
docstr_tok: ["implementation","of",":","class",":","`","~maze.core.env.simulated_env_mixin.SimulatedEnvMixin","`","."]
code: def clone_from(self, env: "GymCoreEnv") -> None:
      """implementation of :class:`~maze.core.env.simulated_env_mixin.SimulatedEnvMixin`."""
  
      # clone core env maze state
      self._maze_state = deepcopy(env._maze_state)
  
      # clone environment state
      parent_target_env = None
      parent_source_env = None
      target_env = self.env
      source_env = env.env
      while hasattr(target_env, "env"):
          assert hasattr(source_env, "env")
  
          # copy state of time limit wrapper
          if isinstance(target_env, TimeLimit):
              assert isinstance(source_env, TimeLimit)
              target_env._max_episode_steps = (
                  source_env._max_episode_steps
              )
              target_env._elapsed_steps = source_env._elapsed_steps
  
          parent_target_env = target_env
          target_env = target_env.env
          parent_source_env = source_env
          source_env = source_env.env
          assert isinstance(source_env, target_env.__class__)
  
      # clone state of classic control environments
      control_envs = (
          CartPoleEnv,
          MountainCarEnv,
          Continuous_MountainCarEnv,
          PendulumEnv,
          AcrobotEnv,
      )
      if isinstance(target_env, control_envs):
          assert isinstance(source_env, control_envs)
          parent_target_env.env = deepcopy(parent_source_env.env)
      # clone state of atari environments
      elif AtariEnv and isinstance(target_env, AtariEnv):
          assert isinstance(source_env, AtariEnv)
          target_env.np_random = deepcopy(source_env.np_random)
          state = source_env.ale.cloneState()
          target_env.ale.restoreState(state)
      # reset is not supported yet
      else:
          raise RuntimeError(
              f"Cloning of {target_env.__class__} env not supported!"
              f"If working with an Atari env make sure all required dependencies are installed "
              f"(e.g., 'pip install gym[atari]')!"
          )
  
imports: from copy import copy, deepcopy
  from typing import Tuple, Union, Any, Dict, Optional
  import gym
  import numpy
  from gym.envs.classic_control import CartPoleEnv, MountainCarEnv, Continuous_MountainCarEnv, PendulumEnv, AcrobotEnv
  from gym.wrappers import TimeLimit
  from maze.core.annotations import override
  from maze.core.env.action_conversion import ActionConversionInterface
  from maze.core.env.core_env import CoreEnv
  from maze.core.env.maze_action import MazeActionType
  from maze.core.env.maze_env import MazeEnv
  from maze.core.env.maze_state import MazeStateType
  from maze.core.env.observation_conversion import ObservationConversionInterface
  from maze.core.env.simulated_env_mixin import SimulatedEnvMixin
  from maze.core.env.structured_env import StepKeyType, ActorID
  from maze.core.log_events.step_event_log import StepEventLog
  from maze.core.rendering.renderer import Renderer
label_desc: Use image node_id 12 for calling the GymCoreEnv obj's underlying member method code with example usage: obj.clone_from(env) without return types