code: def clip_action(action, space):
      
  
      if isinstance(space, gym.spaces.Box):
          return np.clip(action, space.low, space.high)
      elif isinstance(space, gym.spaces.Tuple):
          if type(action) not in (tuple, list):
              raise ValueError("Expected tuple space for actions {}: {}".format(
                  action, space))
          out = []
          for a, s in zip(action, space.spaces):
              out.append(clip_action(a, s))
          return out
      else:
          return action
docs: Called to clip actions to the specified range of this policy.
  
      Arguments:
          action: Single action.
          space: Action space the actions should be present in.
  
      Returns:
          Clipped batch of actions.