code: def run_hyperopt_executor(
      search_alg,
      executor,
      csv_filename,
      ray_mock_dir,
      validate_output_feature=False,
      validation_metric=None,
  ):
      config = _get_config(search_alg, executor)
  
      csv_filename = os.path.join(ray_mock_dir, "dataset.csv")
      dataset_csv = generate_data(
          config["input_features"],
          config["output_features"],
          csv_filename,
          num_examples=25,
      )
      dataset_parquet = create_data_set_to_use("parquet", dataset_csv)
  
      config = ModelConfig.from_dict(config).to_dict()
  
      hyperopt_config = config["hyperopt"]
  
      if validate_output_feature:
          hyperopt_config["output_feature"] = config["output_features"][
              0
          ]["name"]
      if validation_metric:
          hyperopt_config["validation_metric"] = validation_metric
  
      backend = RayBackend(**RAY_BACKEND_KWARGS)
      update_hyperopt_params_with_defaults(hyperopt_config)
      if hyperopt_config[EXECUTOR].get(MAX_CONCURRENT_TRIALS) == AUTO:
          hyperopt_config[EXECUTOR][
              MAX_CONCURRENT_TRIALS
          ] = backend.max_concurrent_trials(hyperopt_config)
  
      parameters = hyperopt_config["parameters"]
      if search_alg.get("type", "") == "bohb":
          # bohb does not support grid_search search space
          del parameters["combiner.output_size"]
          hyperopt_config["parameters"] = parameters
  
      split = hyperopt_config["split"]
      output_feature = hyperopt_config["output_feature"]
      metric = hyperopt_config["metric"]
      goal = hyperopt_config["goal"]
      search_alg = hyperopt_config["search_alg"]
  
      # preprocess
      model = LudwigModel(config=config, backend=backend)
      (
          training_set,
          validation_set,
          test_set,
          training_set_metadata,
      ) = model.preprocess(
          dataset=dataset_parquet,
      )
  
      # hyperopt
      hyperopt_executor = MockRayTuneExecutor(
          parameters,
          output_feature,
          metric,
          goal,
          split,
          search_alg=search_alg,
          **hyperopt_config[EXECUTOR],
      )
      hyperopt_executor.mock_path = os.path.join(ray_mock_dir, "bucket")
  
      hyperopt_executor.execute(
          config,
          training_set=training_set,
          validation_set=validation_set,
          test_set=test_set,
          training_set_metadata=training_set_metadata,
          backend=backend,
          output_directory=ray_mock_dir,
          skip_save_processed_input=True,
          skip_save_unprocessed_output=True,
          resume=False,
      )
  
imports: import os.path
  import shutil
  import uuid
  from unittest.mock import patch
  import pytest
  from ludwig.api import LudwigModel
  from ludwig.callbacks import Callback
  from ludwig.constants import ACCURACY, AUTO, BATCH_SIZE, EXECUTOR, MAX_CONCURRENT_TRIALS, TRAINER
  from ludwig.globals import HYPEROPT_STATISTICS_FILE_NAME
  from ludwig.hyperopt.results import HyperoptResults
  from ludwig.hyperopt.run import hyperopt
  from ludwig.hyperopt.utils import update_hyperopt_params_with_defaults
  from ludwig.schema.model_config import ModelConfig
  from tests.integration_tests.utils import binary_feature, create_data_set_to_use, generate_data, number_feature
label_desc: Use image node_id 4 for calling a global function with example usage: run_hyperopt_executor(search_alg, executor, csv_filename, ray_mock_dir, validate_output_feature, validation_metric) without return types