class_docstr: NaN and inf checking wrapper for vectorized environment, will raise a warning by default,
  allowing you to know from what the NaN of inf originated from.
  
  :param venv: (VecEnv) the vectorized environment to wrap
  :param raise_exception: (bool) Whether or not to raise a ValueError, instead of a UserWarning
  :param warn_once: (bool) Whether or not to only warn once.
  :param check_inf: (bool) Whether or not to check for +inf or -inf as well
code: def _check_val(self, *, async_step, **kwargs):
      # if warn and warn once and have warned once: then stop checking
      if (
          not self.raise_exception
          and self.warn_once
          and self._user_warned
      ):
          return
  
      found = []
      for name, val in kwargs.items():
          has_nan = np.any(np.isnan(val))
          has_inf = self.check_inf and np.any(np.isinf(val))
          if has_inf:
              found.append((name, "inf"))
          if has_nan:
              found.append((name, "nan"))
  
      if found:
          self._user_warned = True
          msg = ""
          for i, (name, type_val) in enumerate(found):
              msg += "found {} in {}".format(type_val, name)
              if i != len(found) - 1:
                  msg += ", "
  
          msg += ".\r\nOriginated from the "
  
          if not async_step:
              if self._actions is None:
                  msg += "environment observation (at reset)"
              else:
                  msg += "environment, Last given value was: \r\n\taction={}".format(
                      self._actions
                  )
          else:
              msg += "RL model, Last given value was: \r\n\tobservations={}".format(
                  self._observations
              )
  
          if self.raise_exception:
              raise ValueError(msg)
          else:
              warnings.warn(msg, UserWarning)
  
file_path: stable-baselines/stable_baselines/common/vec_env/vec_check_nan.py
imports: import warnings
  import numpy
  from stable_baselines.common.vec_env.base_vec_env import VecEnvWrapper
label_desc: Use image node_id 5 for calling the VecCheckNan obj's underlying member method code with example usage: obj._check_val() without return types