class_docstr: A Policy that always knows the current EpisodeID and EnvID and
  returns these in its actions.
class_docstr_tok: ["A","Policy","that","always","knows","the","current","EpisodeID","and","EnvID","and","returns","these","in","its","actions","."]
code: def __init__(self, *args, **kwargs):
      super().__init__(*args, **kwargs)
      self.state_space = Box(-1.0, 1.0, (1,))
      self.config["model"] = {"max_seq_len": 50}
  
      class _fake_model:
          def __init__(self, state_space, config):
              self.state_space = state_space
              self.view_requirements = {
                  SampleBatch.AGENT_INDEX: ViewRequirement(),
                  SampleBatch.EPS_ID: ViewRequirement(),
                  "env_id": ViewRequirement(),
                  "t": ViewRequirement(),
                  SampleBatch.OBS: ViewRequirement(),
                  "state_in_0": ViewRequirement(
                      "state_out_0",
                      # Provide state outs -50 to -1 as "state-in".
                      shift="-50:-1",
                      # Repeat the incoming state every n time steps (usually max seq
                      # len).
                      batch_repeat_value=config["model"]["max_seq_len"],
                      space=state_space,
                  ),
                  "state_out_0": ViewRequirement(
                      space=state_space, used_for_compute_actions=False
                  ),
              }
  
          def compile(self, *args, **kwargs):
              """Dummy method for compatibility with TorchRLModule.
  
              This is hit when RolloutWorker tries to compile TorchRLModule.
              """
              pass
  
          # We need to provide at least an initial state if we want agent collector
          # to build episodes with state_in_ and state_out_
          def get_initial_state(self):
              return [self.state_space.sample()]
  
      self.model = _fake_model(self.state_space, self.config)
  
      self.view_requirements = dict(
          super()._get_default_view_requirements(),
          **self.model.view_requirements,
      )
  
imports: import numpy
  import tree
  from gymnasium.spaces import Box
  from ray.rllib.core.models.base import STATE_OUT
  from ray.rllib.core.rl_module.rl_module import RLModuleConfig
  from ray.rllib.examples.policy.random_policy import RandomPolicy
  from ray.rllib.examples.rl_module.episode_env_aware_rlm import StatefulRandomRLModule
  from ray.rllib.policy.policy import Policy
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.policy.view_requirement import ViewRequirement
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.numpy import convert_to_numpy
label_desc: Use image node_id 1 to create a new EpisodeEnvAwareAttentionPolicy object from inherited base classes: RandomPolicy with example: obj = EpisodeEnvAwareAttentionPolicy()