code: def test_filter():
      # make an RGB observation smaller
      squeeze_filter = InputFilter()
      squeeze_filter.add_observation_filter(
          "observation", "squeeze", ObservationSqueezeFilter()
      )
      squeeze_filter_with_axis = InputFilter()
      squeeze_filter_with_axis.add_observation_filter(
          "observation", "squeeze", ObservationSqueezeFilter(2)
      )
  
      observation = np.random.rand(20, 30, 1, 3)
      env_response = EnvResponse(
          next_state={"observation": observation},
          reward=0,
          game_over=False,
      )
  
      result = squeeze_filter.filter(env_response)[0]
      result_with_axis = squeeze_filter_with_axis.filter(env_response)[
          0
      ]
      unfiltered_observation_shape = env_response.next_state[
          "observation"
      ].shape
      filtered_observation_shape = result.next_state[
          "observation"
      ].shape
      filtered_observation_with_axis_shape = (
          result_with_axis.next_state["observation"].shape
      )
  
      # make sure the original observation is unchanged
      assert unfiltered_observation_shape == observation.shape
  
      # make sure the filtering is done correctly
      assert filtered_observation_shape == (20, 30, 3)
      assert filtered_observation_with_axis_shape == (20, 30, 3)
  
      observation = np.random.rand(1, 30, 1, 3)
      env_response = EnvResponse(
          next_state={"observation": observation},
          reward=0,
          game_over=False,
      )
  
      result = squeeze_filter.filter(env_response)[0]
      assert result.next_state["observation"].shape == (30, 3)
  
file_path: coach/rl_coach/tests/filters/observation/test_observation_squeeze_filter.py
imports: import os
  import sys
  import pytest
  import numpy
  from rl_coach.filters.observation.observation_squeeze_filter import ObservationSqueezeFilter
  from rl_coach.spaces import ObservationSpace
  from rl_coach.core_types import EnvResponse
  from rl_coach.filters.filter import InputFilter
label_desc: Use image node_id 1 for calling a global function with example usage: test_filter() without return types