code: def test_atari_preprocessing_scale(
      grayscale, scaled, max_test_steps=10
  ):
      # arbitrarily chosen number for stepping into env. and ensuring all observations are in the required range
      env = AtariPreprocessing(
          StepAPICompatibility(
              AtariTestingEnv(), output_truncation_bool=True
          ),
          screen_size=84,
          grayscale_obs=grayscale,
          scale_obs=scaled,
          frame_skip=1,
          noop_max=0,
      )
  
      obs, _ = env.reset()
  
      max_obs = 1 if scaled else 255
      assert np.all(0 <= obs) and np.all(obs <= max_obs)
  
      terminated, truncated, step_i = False, False, 0
      while not (terminated or truncated) and step_i <= max_test_steps:
          obs, _, terminated, truncated, _ = env.step(
              env.action_space.sample()
          )
          assert np.all(0 <= obs) and np.all(obs <= max_obs)
  
          step_i += 1
      env.close()
  
file_path: gym/tests/wrappers/test_atari_preprocessing.py
imports: import numpy
  import pytest
  from gym.spaces import Box, Discrete
  from gym.wrappers import AtariPreprocessing, StepAPICompatibility
  from tests.testing_env import GenericTestEnv, old_step_fn
label_desc: Use image node_id 2 for calling a global function with example usage: test_atari_preprocessing_scale(grayscale, scaled, max_test_steps) without return types