class_docstr: Internal adapter of ExternalEnv to BaseEnv.
class_docstr_tok: ["Internal","adapter","of","ExternalEnv","to","BaseEnv","."]
code: def __init__(
      self,
      external_env: "ExternalEnv",
      preprocessor: "Preprocessor" = None,
  ):
      from ray.rllib.env.external_multi_agent_env import (
          ExternalMultiAgentEnv,
      )
  
      self.external_env = external_env
      self.prep = preprocessor
      self.multiagent = issubclass(
          type(external_env), ExternalMultiAgentEnv
      )
      self._action_space = external_env.action_space
      if preprocessor:
          self._observation_space = preprocessor.observation_space
      else:
          self._observation_space = external_env.observation_space
      external_env.start()
  
imports: import gymnasium
  import queue
  import threading
  import uuid
  from typing import Callable, Tuple, Optional, TYPE_CHECKING
  from ray.rllib.env.base_env import BaseEnv
  from ray.rllib.utils.annotations import override, PublicAPI
  from ray.rllib.utils.typing import EnvActionType, EnvInfoDict, EnvObsType, EnvType, MultiEnvDict
  from ray.rllib.utils.deprecation import deprecation_warning
label_desc: Use image node_id 1 to create a new ExternalEnvWrapper object from inherited base classes: BaseEnv with example: obj = ExternalEnvWrapper(external_env, preprocessor)