code: def test_filter(clip_filter):
      transition = EnvResponse(
          next_state={"observation": np.zeros(10)},
          reward=100,
          game_over=False,
      )
      result = clip_filter.filter(transition)[0]
      unfiltered_reward = transition.reward
      filtered_reward = result.reward
  
      # validate that the reward was clipped correctly
      assert filtered_reward == 10
  
      # make sure the original reward is unchanged
      assert unfiltered_reward == 100
  
      # reward in bounds
      transition = EnvResponse(
          next_state={"observation": np.zeros(10)},
          reward=5,
          game_over=False,
      )
      result = clip_filter.filter(transition)[0]
      assert result.reward == 5
  
      # reward below bounds
      transition = EnvResponse(
          next_state={"observation": np.zeros(10)},
          reward=-5,
          game_over=False,
      )
      result = clip_filter.filter(transition)[0]
      assert result.reward == 2
  
file_path: coach/rl_coach/tests/filters/reward/test_reward_clipping_filter.py
imports: import os
  import sys
  import pytest
  import numpy
  from rl_coach.filters.reward.reward_clipping_filter import RewardClippingFilter
  from rl_coach.spaces import RewardSpace
  from rl_coach.core_types import EnvResponse
  from collections import OrderedDict
  from rl_coach.filters.filter import InputFilter
label_desc: Use image node_id 2 for calling a global function with example usage: test_filter(clip_filter) without return types