code: def test_filter():
      # make an RGB observation smaller
      uint8_filter = InputFilter()
      uint8_filter.add_observation_filter(
          "observation",
          "to_uint8",
          ObservationToUInt8Filter(input_low=0, input_high=255),
      )
  
      observation = np.random.rand(20, 30, 3) * 255.0
      env_response = EnvResponse(
          next_state={"observation": observation},
          reward=0,
          game_over=False,
      )
  
      result = uint8_filter.filter(env_response)[0]
      unfiltered_observation = env_response.next_state["observation"]
      filtered_observation = result.next_state["observation"]
  
      # make sure the original observation is unchanged
      assert unfiltered_observation.dtype == "float64"
  
      # make sure the filtering is done correctly
      assert filtered_observation.dtype == "uint8"
      assert np.all(filtered_observation == observation.astype("uint8"))
  
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 1 for calling a global function with example usage: test_filter() without return types