class_docstr: General abstract class for rollout runners.
  
  Offers general structure, plus a couple of helper methods for env instantiation and performing the rollout.
  
  :param n_episodes: Count of episodes to run. If explicit seeds are given the actual number of episodes is given by
                     min(n_episodes, n_seeds).
  :param max_episode_steps: Count of steps to run in each episode (if environment returns done, the episode
                            will be finished earlier though).
  :param deterministic: Deterministic or stochastic action sampling.
  :param record_trajectory: Whether to record trajectory data.
  :param record_event_logs: Whether to record event logs.
class_docstr_tok: ["General","abstract","class","for","rollout","runners",".","Offers","general","structure",",","plus","a","couple","of","helper","methods","for","env","instantiation","and","performing","the","rollout",".",":","param","n_episodes",":","Count","of","episodes","to","run",".","If","explicit","seeds","are","given","the","actual","number","of","episodes","is","given","by","min","(","n_episodes",",","n_seeds",")",".",":","param","max_episode_steps",":","Count","of","steps","to","run","in","each","episode","(","if","environment","returns","done",",","the","episode","will","be","finished","earlier","though",")",".",":","param","deterministic",":","Deterministic","or","stochastic","action","sampling",".",":","param","record_trajectory",":","Whether","to","record","trajectory","data",".",":","param","record_event_logs",":","Whether","to","record","event","logs","."]
docstr: Run the rollout with the given env, wrappers and agent configuration. A helper method to make rollouts
  easily runnable also directly from python, without building the hydra config object.
  
  Note that this method is designed to run only once -- if you call it from python directly (and not using
  Hydra from command line as is the main use case), you should respect this. Otherwise, you might get
  weird behavior especially from the statistics and events logging system, as the rollout runners register
  their own stats and event writers (so you might get duplicate stats) and order of operations sometimes
  matters (especially with parallel rollouts, where we do not want to carry the writers into child processes).
  
  :param env: Env config or object.
  :param wrappers: Wrappers config (see :class:`~maze.core.wrappers.wrapper_factory.WrapperFactory`).
  :param agent: Agent config or object.
docstr_tok: ["Run","the","rollout","with","the","given","env",",","wrappers","and","agent","configuration",".","A","helper","method","to","make","rollouts","easily","runnable","also","directly","from","python",",","without","building","the","hydra","config","object",".","Note","that","this","method","is","designed","to","run","only","once","--","if","you","call","it","from","python","directly","(","and","not","using","Hydra","from","command","line","as","is","the","main","use","case",")",",","you","should","respect","this",".","Otherwise",",","you","might","get","weird","behavior","especially","from","the","statistics","and","events","logging","system",",","as","the","rollout","runners","register","their","own","stats","and","event","writers","(","so","you","might","get","duplicate","stats",")","and","order","of","operations","sometimes","matters","(","especially","with","parallel","rollouts",",","where","we","do","not","want","to","carry","the","writers","into","child","processes",")",".",":","param","env",":","Env","config","or","object",".",":","param","wrappers",":","Wrappers","config","(","see",":","class",":","`","~maze.core.wrappers.wrapper_factory.WrapperFactory","`",")",".",":","param","agent",":","Agent","config","or","object","."]
code: def run_with(
      self,
      env: ConfigType,
      wrappers: CollectionOfConfigType,
      agent: ConfigType,
  ) -> None:
      """Run the rollout with the given env, wrappers and agent configuration. A helper method to make rollouts
      easily runnable also directly from python, without building the hydra config object.
  
      Note that this method is designed to run only once -- if you call it from python directly (and not using
      Hydra from command line as is the main use case), you should respect this. Otherwise, you might get
      weird behavior especially from the statistics and events logging system, as the rollout runners register
      their own stats and event writers (so you might get duplicate stats) and order of operations sometimes
      matters (especially with parallel rollouts, where we do not want to carry the writers into child processes).
  
      :param env: Env config or object.
      :param wrappers: Wrappers config (see :class:`~maze.core.wrappers.wrapper_factory.WrapperFactory`).
      :param agent: Agent config or object.
      """
  
imports: import time
  from abc import ABC, abstractmethod
  from typing import Callable, Optional, List, Any
  import numpy
  from omegaconf import DictConfig
  from maze.core.agent.policy import Policy
  from maze.core.annotations import override
  from maze.core.env.maze_env import MazeEnv
  from maze.core.env.observation_conversion import ObservationType
  from maze.core.env.structured_env import StructuredEnv
  from maze.core.utils.config_utils import EnvFactory, SwitchWorkingDirectoryToInput
  from maze.core.utils.factory import Factory, ConfigType, CollectionOfConfigType
  from maze.core.utils.seeding import MazeSeeding
  from maze.core.wrappers.time_limit_wrapper import TimeLimitWrapper
  from maze.core.wrappers.trajectory_recording_wrapper import TrajectoryRecordingWrapper
  from maze.runner import Runner
  from maze.utils.bcolors import BColors
label_desc: Use image node_id 4 for calling the RolloutRunner obj's underlying member method code with example usage: obj.run_with(env, wrappers, agent) without return types