class_docstr: Qlib-based RL environment, subclassing ``gym.Env``.
  A wrapper of components, including simulator, state-interpreter, action-interpreter, reward.
  
  This is what the framework of simulator - interpreter - policy looks like in RL training.
  All the components other than policy needs to be assembled into a single object called "environment".
  The "environment" are replicated into multiple workers, and (at least in tianshou's implementation),
  one single policy (agent) plays against a batch of environments.
  
  Parameters
  ----------
  simulator_fn
      A callable that is the simulator factory.
      When ``seed_iterator`` is present, the factory should take one argument,
      that is the seed (aka initial state).
      Otherwise, it should take zero argument.
  state_interpreter
      State-observation converter.
  action_interpreter
      Policy-simulator action converter.
  seed_iterator
      An iterable of seed. With the help of :class:`qlib.rl.utils.DataQueue`,
      environment workers in different processes can share one ``seed_iterator``.
  reward_fn
      A callable that accepts the StateType and returns a float (at least in single-agent case).
  aux_info_collector
      Collect auxiliary information. Could be useful in MARL.
  logger
      Log collector that collects the logs. The collected logs are sent back to main process,
      via the return value of ``env.step()``.
  
  Attributes
  ----------
  status : EnvWrapperStatus
      Status indicator. All terms are in *RL language*.
      It can be used if users care about data on the RL side.
      Can be none when no trajectory is available.
docstr: Try to get a state from state queue, and init the simulator with this state.
  If the queue is exhausted, generate an invalid (nan) observation.
docstr_tok: ["Try","to","get","a","state","from","state","queue",",","and","init","the","simulator","with","this","state",".","If","the","queue","is","exhausted",",","generate","an","invalid","(","nan",")","observation","."]
code: def reset(self, **kwargs: Any) -> ObsType:
      """
      Try to get a state from state queue, and init the simulator with this state.
      If the queue is exhausted, generate an invalid (nan) observation.
      """
  
      try:
          if self.seed_iterator is None:
              raise RuntimeError(
                  "You can trying to get a state from a dead environment wrapper."
              )
  
          # TODO: simulator/observation might need seed to prefetch something
          # as only seed has the ability to do the work beforehands
  
          # NOTE: though logger is reset here, logs in this function won't work,
          # because we can't send them outside.
          # See https://github.com/thu-ml/tianshou/issues/605
          self.logger.reset()
  
          if self.seed_iterator is SEED_INTERATOR_MISSING:
              # no initial state
              initial_state = None
              self.simulator = cast(
                  Callable[[], Simulator], self.simulator_fn
              )()
          else:
              initial_state = next(
                  cast(Iterator[InitialStateType], self.seed_iterator)
              )
              self.simulator = self.simulator_fn(initial_state)
  
          self.status = EnvWrapperStatus(
              cur_step=0,
              done=False,
              initial_state=initial_state,
              obs_history=[],
              action_history=[],
              reward_history=[],
          )
  
          self.simulator.env = cast(EnvWrapper, weakref.proxy(self))
  
          sim_state = self.simulator.get_state()
          obs = self.state_interpreter(sim_state)
  
          self.status["obs_history"].append(obs)
  
          return obs
  
      except StopIteration:
          # The environment should be recycled because it's in a dead state.
          self.seed_iterator = None
          return generate_nan_observation(self.observation_space)
  
imports: from __future__ import annotations
  import weakref
  from typing import Any, Callable, cast, Dict, Generic, Iterable, Iterator, Optional, Tuple
  import gym
  from gym import Space
  from qlib.rl.aux_info import AuxiliaryInfoCollector
  from qlib.rl.interpreter import ActionInterpreter, ObsType, PolicyActType, StateInterpreter
  from qlib.rl.reward import Reward
  from qlib.rl.simulator import ActType, InitialStateType, Simulator, StateType
  from qlib.typehint import TypedDict
  from .finite_env import generate_nan_observation
  from .log import LogCollector, LogLevel
label_desc: Use image node_id 4 for calling the EnvWrapper obj's underlying member method code with example usage: obj.reset() and returns: obs, generate_nan_observation