code: def test_non_default_spaces(new_obs_space):
      env = gym.make("BreakoutNoFrameskip-v4")
      env.observation_space = new_obs_space
      # Patch methods to avoid errors
      env.reset = new_obs_space.sample
  
      def patched_step(_action):
          return new_obs_space.sample(), 0.0, False, {}
  
      env.step = patched_step
      with pytest.warns(UserWarning):
          check_env(env)
  
file_path: stable-baselines/tests/test_envs.py
imports: import pytest
  import gym
  from gym import spaces
  import numpy
  from stable_baselines.common.env_checker import check_env
  from stable_baselines.common.bit_flipping_env import BitFlippingEnv
  from stable_baselines.common.identity_env import IdentityEnv, IdentityEnvBox, IdentityEnvMultiBinary, IdentityEnvMultiDiscrete
label_desc: Use image node_id 4 for calling a global function with example usage: test_non_default_spaces(new_obs_space) and returns: new_obs_space,  int,  False,  dict