code: def check_env(
      env: gym.Env, warn: bool = None, skip_render_check: bool = False
  ):
      """Check that an environment follows Gym API.
  
      This is an invasive function that calls the environment's reset and step.
  
      This is particularly useful when using a custom environment.
      Please take a look at https://www.gymlibrary.dev/content/environment_creation/
      for more information about the API.
  
      Args:
          env: The Gym environment that will be checked
          warn: Ignored
          skip_render_check: Whether to skip the checks for the render method. True by default (useful for the CI)
      """
      if warn is not None:
          logger.warn("`check_env(warn=...)` parameter is now ignored.")
  
      assert isinstance(
          env, gym.Env
      ), "The environment must inherit from the gym.Env class. See https://www.gymlibrary.dev/content/environment_creation/ for more info."
  
      if env.unwrapped is not env:
          logger.warn(
              f"The environment ({env}) is different from the unwrapped version ({env.unwrapped}). This could effect the environment checker as the environment most likely has a wrapper applied to it. We recommend using the raw environment for `check_env` using `env.unwrapped`."
          )
  
      # ============= Check the spaces (observation and action) ================
      assert hasattr(
          env, "action_space"
      ), "The environment must specify an action space. See https://www.gymlibrary.dev/content/environment_creation/ for more info."
      check_action_space(env.action_space)
      check_space_limit(env.action_space, "action")
  
      assert hasattr(
          env, "observation_space"
      ), "The environment must specify an observation space. See https://www.gymlibrary.dev/content/environment_creation/ for more info."
      check_observation_space(env.observation_space)
      check_space_limit(env.observation_space, "observation")
  
      # ==== Check the reset method ====
      check_seed_deprecation(env)
      check_reset_return_info_deprecation(env)
      check_reset_return_type(env)
      check_reset_seed(env)
      check_reset_options(env)
  
      # ============ Check the returned values ===============
      env_reset_passive_checker(env)
      env_step_passive_checker(env, env.action_space.sample())
  
      # ==== Check the render method and the declared render modes ====
      if not skip_render_check:
          if env.render_mode is not None:
              env_render_passive_checker(env)
  
file_path: gym/gym/utils/env_checker.py
imports: import inspect
  from copy import deepcopy
  import numpy
  import gym
  from gym import logger, spaces
  from gym.utils.passive_env_checker import check_action_space, check_observation_space, env_render_passive_checker, env_reset_passive_checker, env_step_passive_checker
label_desc: Use image node_id 8 for calling a global function with example usage: check_env(env, warn, skip_render_check) without return types