code: def test_rgb2gray_pre_processors():
      """perception test"""
  
      obs_space = build_dict_obs_space()
      space_dict = obs_space.spaces
      sample = obs_space.sample()
      sample["image"][:, :, :] = 1.0
  
      processor = Rgb2GrayPreProcessor(
          observation_space=space_dict["image"], rgb_dim=-3
      )
      assert processor.tag() == "rgb2gray"
      processed = processor.process(sample["image"])
  
      assert processed in processor.processed_space()
      assert processor.processed_shape() == processed.shape
      assert processed.shape == (32, 32)
      assert processor.tag() == "rgb2gray"
      assert np.allclose(processed, np.sum([0.299, 0.587, 0.114]))
  
file_path: maze/maze/test/core/wrappers/observation_preprocessing/preprocessors/test_preprocessors.py
imports: import gym
  import numpy
  from maze.core.wrappers.observation_preprocessing.preprocessors.flatten import FlattenPreProcessor
  from maze.core.wrappers.observation_preprocessing.preprocessors.one_hot import OneHotPreProcessor
  from maze.core.wrappers.observation_preprocessing.preprocessors.resize_img import ResizeImgPreProcessor
  from maze.core.wrappers.observation_preprocessing.preprocessors.rgb2gray import Rgb2GrayPreProcessor
  from maze.core.wrappers.observation_preprocessing.preprocessors.transpose import TransposePreProcessor
  from maze.core.wrappers.observation_preprocessing.preprocessors.unsqueeze import UnSqueezePreProcessor
  from maze.test.shared_test_utils.space_testing_utils import build_dict_obs_space
label_desc: Use image node_id 5 for calling a global function with example usage: test_rgb2gray_pre_processors() without return types