class_docstr: Affinely rescales the continuous action space of the environment to the range [min_action, max_action].
  
  The base environment :attr:`env` must have an action space of type :class:`spaces.Box`. If :attr:`min_action`
  or :attr:`max_action` are numpy arrays, the shape must match the shape of the environment's action space.
  
  Example:
      >>> import gym
      >>> env = gym.make('BipedalWalker-v3')
      >>> env.action_space
      Box(-1.0, 1.0, (4,), float32)
      >>> min_action = -0.5
      >>> max_action = np.array([0.0, 0.5, 1.0, 0.75])
      >>> env = RescaleAction(env, min_action=min_action, max_action=max_action)
      >>> env.action_space
      Box(-0.5, [0.   0.5  1.   0.75], (4,), float32)
      >>> RescaleAction(env, min_action, max_action).action_space == gym.spaces.Box(min_action, max_action)
      True
docstr: Rescales the action affinely from  [:attr:`min_action`, :attr:`max_action`] to the action space of the base environment, :attr:`env`.
  
  Args:
      action: The action to rescale
  
  Returns:
      The rescaled action
docstr_tok: ["Rescales","the","action","affinely","from","[",":","attr",":","`","min_action","`",",",":","attr",":","`","max_action","`","]","to","the","action","space","of","the","base","environment",",",":","attr",":","`","env","`",".","Args",":","action",":","The","action","to","rescale","Returns",":","The","rescaled","action"]
code: def action(self, action):
      """Rescales the action affinely from  [:attr:`min_action`, :attr:`max_action`] to the action space of the base environment, :attr:`env`.
  
      Args:
          action: The action to rescale
  
      Returns:
          The rescaled action
      """
      assert np.all(np.greater_equal(action, self.min_action)), (
          action,
          self.min_action,
      )
      assert np.all(np.less_equal(action, self.max_action)), (
          action,
          self.max_action,
      )
      low = self.env.action_space.low
      high = self.env.action_space.high
      action = low + (high - low) * (
          (action - self.min_action)
          / (self.max_action - self.min_action)
      )
      action = np.clip(action, low, high)
      return action
  
imports: from typing import Union
  import numpy
  import gym
  from gym import spaces
label_desc: Use image node_id 2 for calling the RescaleAction obj's underlying member method code with example usage: obj.action(action) and returns: action