code: def test_config_pickling():
      # check that the real thing can be pickled
      root = configdefaults.config
      buffer = io.BytesIO()
      pickle.dump(root, buffer)
      # and also unpickled...
      buffer.seek(0)
      restored = pickle.load(buffer)
      # ...without a change in the config values
      for name in root._config_var_dict.keys():
          v_original = getattr(root, name)
          v_restored = getattr(restored, name)
          assert (
              v_restored == v_original
          ), f"{name} did not survive pickling ({v_restored} != {v_original})"
  
      # and validate that the test would catch typical problems
      root = _create_test_config()
      root.add(
          "test__lambda_kills_pickling",
          "Lambda functions cause pickling problems.",
          configparser.IntParam(5, lambda i: i > 0),
      )
      with pytest.raises(
          AttributeError, match="Can't pickle local object"
      ):
          pickle.dump(root, io.BytesIO())
  
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 10 for calling a global function with example usage: test_config_pickling() without return types