code: def check_scaled_actions_from_range(low, high, scalar=False):
      """
      helper method which creates dummy action space spanning between respective components of low and high
      and then checks scaling to and from tanh co-domain for low, middle and high value from  that action space
      :param low: (np.ndarray), (int) or (float)
      :param high: (np.ndarray), (int) or (float)
      :param scalar: (bool) Whether consider scalar range or wrap it into 1d vector
      """
  
      if scalar and (isinstance(low, float) or isinstance(low, int)):
          ones = 1.0
          action_space = Box(low, high, shape=(1,))
      else:
          low = np.atleast_1d(low)
          high = np.atleast_1d(high)
          ones = np.ones_like(low)
          action_space = Box(low, high)
  
      mid = 0.5 * (low + high)
  
      expected_mapping = [(low, -ones), (mid, 0.0 * ones), (high, ones)]
  
      for not_scaled, scaled in expected_mapping:
          assert np.allclose(
              scale_action(action_space, not_scaled), scaled
          )
          assert np.allclose(
              unscale_action(action_space, scaled), not_scaled
          )
  
imports: import tensorflow
  import numpy
  from gym.spaces.box import Box
  from stable_baselines.common.math_util import discount_with_boundaries, scale_action, unscale_action
label_desc: Use image node_id 3 for calling a global function with example usage: check_scaled_actions_from_range(low, high, scalar) without return types