code: def test_kfold_cv_cli(tmpdir, features_to_use: FeaturesToUse):
      # k-fold cross validation cli
      num_folds = 3
  
      training_data_fp = os.path.join(tmpdir, "train.csv")
      config_fp = os.path.join(tmpdir, "config.yaml")
      results_dir = os.path.join(tmpdir, "results")
      statistics_fp = os.path.join(
          results_dir, "kfold_training_statistics.json"
      )
      indices_fp = os.path.join(results_dir, "kfold_split_indices.json")
  
      # generate synthetic data for the test
      input_features = features_to_use.input_features
  
      output_features = features_to_use.output_features
  
      generate_data(input_features, output_features, training_data_fp)
  
      # generate config file
      config = {
          "input_features": input_features,
          "output_features": output_features,
          "combiner": {"type": "concat", "output_size": 14},
          TRAINER: {"epochs": 2, BATCH_SIZE: 128},
      }
  
      with open(config_fp, "w") as f:
          yaml.dump(config, f)
  
      # run k-fold cv
      kfold_cross_validate_cli(
          k_fold=num_folds,
          config=config_fp,
          dataset=training_data_fp,
          output_directory=results_dir,
          logging_level="warn",
      )
  
      # check for expected results
      # check for existence and structure of statistics file
      assert os.path.isfile(statistics_fp)
  
      # check for required keys
      cv_statistics = load_json(statistics_fp)
      for key in ["fold_" + str(i + 1) for i in range(num_folds)] + [
          "overall"
      ]:
          assert key in cv_statistics
  
      # check for existence and structure of split indices file
      assert os.path.isfile(indices_fp)
  
      # check for required keys
      cv_indices = load_json(indices_fp)
      for key in ["fold_" + str(i + 1) for i in range(num_folds)]:
          assert key in cv_indices
  
file_path: ludwig/tests/integration_tests/test_kfold_cv.py
imports: import logging
  import os
  import os.path
  from collections import namedtuple
  import pytest
  import yaml
  from ludwig.api import kfold_cross_validate
  from ludwig.constants import BATCH_SIZE, TRAINER
  from ludwig.experiment import kfold_cross_validate_cli
  from ludwig.utils.data_utils import load_json
  from tests.integration_tests.utils import binary_feature, category_feature, create_data_set_to_use, generate_data, number_feature, sequence_feature, text_feature
label_desc: Use image node_id 1 for calling a global function with example usage: test_kfold_cv_cli(tmpdir, features_to_use) without return types