code: def test_get_filtered_observation_space():
      # error on observation space with values not matching the filter configuration
      uint8_filter = InputFilter()
      uint8_filter.add_observation_filter(
          "observation",
          "to_uint8",
          ObservationToUInt8Filter(input_low=0, input_high=200),
      )
  
      observation_space = ObservationSpace(np.array([1, 2, 3]), 0, 100)
      with pytest.raises(ValueError):
          uint8_filter.get_filtered_observation_space(
              "observation", observation_space
          )
  
      # verify output observation space is correct
      observation_space = ObservationSpace(np.array([1, 2, 3]), 0, 200)
      result = uint8_filter.get_filtered_observation_space(
          "observation", observation_space
      )
      assert np.all(result.high == 255)
      assert np.all(result.low == 0)
      assert np.all(result.shape == observation_space.shape)
  
file_path: coach/rl_coach/tests/filters/observation/test_observation_to_uint8_filter.py
imports: import os
  import sys
  import pytest
  import numpy
  from rl_coach.filters.observation.observation_to_uint8_filter import ObservationToUInt8Filter
  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 2 for calling a global function with example usage: test_get_filtered_observation_space() without return types