class_docstr: A randomly acting environment that publishes an action-mask each step.
code: def _fix_action_mask(self, obs):
      # Fix action-mask: Everything larger 0.5 is 1.0, everything else 0.0.
      self.valid_actions = np.round(obs["action_mask"])
      obs["action_mask"] = self.valid_actions
  
file_path: ray/rllib/examples/env/action_mask_env.py
imports: from gymnasium.spaces import Box, Dict, Discrete
  import numpy
  from ray.rllib.examples.env.random_env import RandomEnv
label_desc: Use image node_id 4 for calling the ActionMaskEnv obj's underlying member method code with example usage: obj._fix_action_mask(obs) without return types