code: def test_out_of_time_and_space_splitter():
      result, logs = out_of_time_and_space_splitter(
          sample_data,
          2,
          "2015-05-05",
          time_column="time",
          space_column="space",
          holdout_gap=timedelta(days=31),
      )
  
      assert len(result) == 2
      train_1 = sample_data.iloc[result[0][0]]
      test_1 = sample_data.iloc[result[0][1][0]]
      train_2 = sample_data.iloc[result[1][0]]
      test_2 = sample_data.iloc[result[1][1][0]]
  
      # there must be no overlap in space between folds
      assert len(train_1[train_1.space.isin(train_2.space)]) == 0
      assert len(train_2[train_2.space.isin(train_1.space)]) == 0
  
      # the training sets must have no dates after 2015-05-05
      assert len(train_1[train_1.time > "2015-05-05"]) == 0
      assert len(train_2[train_2.time > "2015-05-05"]) == 0
  
      # the test sets must have no dates before 2015-05-05 + 31 days
      assert len(test_1[test_1.time <= "2015-06-05"]) == 0
      assert len(test_2[test_2.time <= "2015-06-05"]) == 0
  
      # all rows with time before '2015-05-05' must be in a training set
      assert len(train_1) + len(train_2) == len(
          sample_data[sample_data.time <= "2015-05-05"]
      )
  
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 2 for calling a global function with example usage: test_out_of_time_and_space_splitter() without return types