code: def test_mode_apply():
      assert configdefaults._filter_mode("DebugMode") == "DebugMode"
  
      with pytest.raises(ValueError, match="Expected one of"):
          configdefaults._filter_mode("not_a_mode")
  
      # test with Mode instance
      import pytensor.compile.mode
  
      assert (
          configdefaults._filter_mode(
              pytensor.compile.mode.FAST_COMPILE
          )
          == pytensor.compile.mode.FAST_COMPILE
      )
  
imports: import configparser
  import io
  import pickle
  import pytest
  from pytensor import configdefaults, configparser
  from pytensor.configdefaults import short_platform
  from pytensor.configparser import ConfigParam
label_desc: Use image node_id 9 for calling a global function with example usage: test_mode_apply() without return types