code: def test_nested_parameter_key_check(categories, raises_exception):
      """Test that nested parameters are validated correctly."""
      config = {
          INPUT_FEATURES: [text_feature(name="in_feature")],
          OUTPUT_FEATURES: [binary_feature(name="out_feature")],
          HYPEROPT: {
              SEARCH_ALG: {TYPE: "random"},
              PARAMETERS: {
                  ".": {"space": "choice", "categories": categories}
              },
          },
      }
  
      if raises_exception:
          with pytest.raises(ConfigValidationError):
              ModelConfig.from_dict(config)
      else:
          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 5 for calling a global function with example usage: test_nested_parameter_key_check(categories, raises_exception) without return types