code: def test_parameter_type_check(space, raises_exception):
      """Test that the parameter type is a valid hyperparameter search space.
  
      This should only be valid until the search space schema is updated to validate spaces as config objects rather than
      dicts. That update is non-trivial, so to hold over until it is ready we cast the dicts to the corresponding
      parameter objects and validate as an aux check. The test covers every valid space and one invalid space.
      """
      config = {
          INPUT_FEATURES: [text_feature()],
          OUTPUT_FEATURES: [binary_feature()],
          HYPEROPT: {
              SEARCH_ALG: {TYPE: "random"},
              PARAMETERS: {
                  "trainer.learning_rate": {
                      "space": space,
                  }
              },
          },
      }
  
      if not raises_exception:
          ModelConfig.from_dict(config)
      else:
          with pytest.raises(ConfigValidationError):
              ModelConfig.from_dict(config)
  
file_path: ludwig/tests/ludwig/config_validation/test_validate_config_hyperopt.py
imports: from itertools import repeat
  from unittest.mock import patch
  import pytest
  import ludwig.schema.hyperopt.parameter
  import ludwig.schema.hyperopt.scheduler
  import ludwig.schema.hyperopt.search_algorithm
  from ludwig.constants import EXECUTOR, HYPEROPT, INPUT_FEATURES, OUTPUT_FEATURES, PARAMETERS, SCHEDULER, SEARCH_ALG, TYPE
  from ludwig.error import ConfigValidationError
  from ludwig.schema.hyperopt import utils
  from ludwig.schema.model_types.base import ModelConfig
  from tests.integration_tests.utils import binary_feature, text_feature
label_desc: Use image node_id 3 for calling a global function with example usage: test_parameter_type_check(space, raises_exception) without return types