code: def test_filter_observation(self, observation_keys, filter_keys):
      env = FakeEnvironment(observation_keys=observation_keys)
  
      # Make sure we are testing the right environment for the test.
      observation_space = env.observation_space
      assert isinstance(observation_space, spaces.Dict)
  
      wrapped_env = FilterObservation(env, filter_keys=filter_keys)
  
      assert isinstance(wrapped_env.observation_space, spaces.Dict)
  
      if filter_keys is None:
          filter_keys = tuple(observation_keys)
  
      assert len(wrapped_env.observation_space.spaces) == len(
          filter_keys
      )
      assert tuple(
          wrapped_env.observation_space.spaces.keys()
      ) == tuple(filter_keys)
  
      # Check that the added space item is consistent with the added observation.
      observation, info = wrapped_env.reset()
      assert len(observation) == len(filter_keys)
      assert isinstance(info, dict)
  
file_path: gym/tests/wrappers/test_filter_observation.py
imports: from typing import Optional, Tuple
  import numpy
  import pytest
  import gym
  from gym import spaces
  from gym.wrappers.filter_observation import FilterObservation
label_desc: Use image node_id 1 for calling the TestFilterObservation obj's underlying member method code with example usage: obj.test_filter_observation(observation_keys, filter_keys) without return types