class_docstr: A CartPole env that crashes (or stalls) from time to time.
  
  Useful for testing faulty sub-env (within a vectorized env) handling by
  EnvRunners.
  
  After crashing, the env expects a `reset()` call next (calling `step()` will
  result in yet another error), which may or may not take a very long time to
  complete. This simulates the env having to reinitialize some sub-processes, e.g.
  an external connection.
  
  The env can also be configured to stall (and do nothing during a call to `step()`)
  from time to time for a configurable amount of time.
code: def reset(self, *, seed=None, options=None):
      # Reset timestep counter for the new episode.
      self.timesteps = 0
      self._crash_after_n_steps = None
  
      # Should we crash?
      if self._should_crash(p=self.p_crash_reset):
          raise EnvError(
              f"Simulated env crash on worker={self.config.worker_index} "
              f"env-idx={self.config.vector_index} during `reset()`! "
              "Feel free to use any other exception type here instead."
          )
      # Should we stall for a while?
      self._stall_if_necessary(p=self.p_stall_reset)
  
      return super().reset()
  
file_path: ray/python/ray/rllib/examples/env/cartpole_crashing.py
imports: import logging
  from gymnasium.envs.classic_control import CartPoleEnv
  import numpy
  import time
  from ray.rllib.examples.env.multi_agent import make_multi_agent
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.error import EnvError
label_desc: Use image node_id 2 for calling the CartPoleCrashing obj's underlying member method code with example usage: obj.reset() and returns: super