code: def test_k_fold_splitter():
      # testing without stratification
      result, logs = k_fold_splitter(sample_data, 2, random_state=42)
  
      assert len(result) == 2
  
      train_1_idx = result[0][0]
      test_1_idx = result[0][1][0]
      train_2_idx = result[1][0]
      test_2_idx = result[1][1][0]
  
      assert set(train_1_idx) == set(test_2_idx)
      assert set(test_1_idx) == set(train_2_idx)
  
      # testing with stratification
      result, logs = k_fold_splitter(
          sample_data, 2, random_state=42, stratify_column="space"
      )
  
      assert len(result) == 2
  
      train_1_idx = result[0][0]
      test_1_idx = result[0][1][0]
      train_2_idx = result[1][0]
      test_2_idx = result[1][1][0]
  
      assert set(train_1_idx) == set(test_2_idx)
      assert set(test_1_idx) == set(train_2_idx)
  
      train_1_strat = sample_data.iloc[train_1_idx]["space"]
      test_1_strat = sample_data.iloc[test_1_idx]["space"]
      train_2_strat = sample_data.iloc[train_2_idx]["space"]
      test_2_strat = sample_data.iloc[test_2_idx]["space"]
  
      assert train_1_strat.nunique() == test_2_strat.nunique()
      assert train_2_strat.nunique() == test_1_strat.nunique()
  
file_path: fklearn/tests/validation/test_splitters.py
imports: from datetime import timedelta
  import pandas
  import pytest
  from fklearn.validation.splitters import k_fold_splitter, out_of_time_and_space_splitter, spatial_learning_curve_splitter, time_learning_curve_splitter, reverse_time_learning_curve_splitter, stability_curve_time_splitter, stability_curve_time_in_space_splitter, stability_curve_time_space_splitter, forward_stability_curve_time_splitter, time_and_space_learning_curve_splitter
label_desc: Use image node_id 1 for calling a global function with example usage: test_k_fold_splitter() without return types