code: def test_get_filtered_observation_space(stack_filter, env_response):
      observation_space = ObservationSpace(np.array([5, 10, 20]))
      filtered_observation_space = (
          stack_filter.get_filtered_observation_space(
              "observation", observation_space
          )
      )
  
      # make sure the new observation space shape is calculated correctly
      assert np.all(
          filtered_observation_space.shape == np.array([5, 10, 20, 4])
      )
  
      # make sure the original observation space is unchanged
      assert np.all(observation_space.shape == np.array([5, 10, 20]))
  
      # call after stack is already created with non-matching shape -> error
      result = stack_filter.filter(env_response)[0]
      with pytest.raises(ValueError):
          filtered_observation_space = (
              stack_filter.get_filtered_observation_space(
                  "observation", observation_space
              )
          )
  
file_path: coach/rl_coach/tests/filters/observation/test_observation_stacking_filter.py
imports: import os
  import sys
  import pytest
  import numpy
  from rl_coach.filters.observation.observation_stacking_filter import ObservationStackingFilter
  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 4 for calling a global function with example usage: test_get_filtered_observation_space(stack_filter, env_response) without return types