code: def test_config_param_apply_and_validation():
      cp = ConfigParam(
          "TheDeFauLt",
          apply=lambda v: v.lower(),
          validate=lambda v: v in "thedefault,thesetting",
          mutable=True,
      )
      assert cp.default == "TheDeFauLt"
      assert not hasattr(cp, "val")
  
      # can't assign invalid value
      with pytest.raises(ValueError, match="Invalid value"):
          cp.__set__("cls", "invalid")
  
      assert not hasattr(cp, "val")
  
      # effectivity of apply function
      cp.__set__("cls", "THESETTING")
      assert cp.val == "thesetting"
  
      # respect the mutability
      cp._mutable = False
      with pytest.raises(Exception, match="Can't change"):
          cp.__set__("cls", "THEDEFAULT")
  
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 3 for calling a global function with example usage: test_config_param_apply_and_validation() without return types