code: def test_kfold_cv_api_in_memory(tmpdir):
      # k-fold_cross_validate api with in-memory config
      num_folds = 3
  
      # setup required data structures for test
      training_data_fp = os.path.join(tmpdir, "train.csv")
  
      # generate synthetic data for the test
      input_features = [
          number_feature(normalization="zscore"),
          number_feature(normalization="zscore"),
      ]
  
      output_features = [number_feature()]
  
      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},
      }
  
      # test kfold_cross_validate api with config in-memory
  
      # execute k-fold cross validation run
      (kfold_cv_stats, kfold_split_indices) = kfold_cross_validate(
          3, config=config, dataset=training_data_fp
      )
  
      # correct structure for results from kfold cv
      for key in ["fold_" + str(i + 1) for i in range(num_folds)] + [
          "overall"
      ]:
          assert key in kfold_cv_stats
  
      for key in ["fold_" + str(i + 1) for i in range(num_folds)]:
          assert key in kfold_split_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 3 for calling a global function with example usage: test_kfold_cv_api_in_memory(tmpdir) without return types