code: def test_spatial_learning_curve_splitter():
      result, logs = spatial_learning_curve_splitter(
          sample_data,
          train_percentages=[0.5, 1.0],
          space_column="space",
          time_column="time",
          training_limit="2015-09-09",
          holdout_gap=timedelta(days=180),
          random_state=0,
      )
  
      assert len(result) == 2
  
      train_1 = sample_data.iloc[result[0][0]]
      train_2 = sample_data.iloc[result[1][0]]
      test_1 = sample_data.iloc[result[0][1][0]]
      test_2 = sample_data.iloc[result[1][1][0]]
  
      assert test_1.equals(test_2)
      assert (
          len(set(train_1["space"]).intersection(train_2["space"])) > 0
      )
      assert train_1["time"].max() < test_1["time"].min()
      assert train_2["time"].max() < test_2["time"].min()
      assert test_1["time"].min() - train_1["time"].max() >= timedelta(
          days=180
      )
      assert test_2["time"].min() - train_2["time"].max() >= timedelta(
          days=180
      )
      assert len(train_2) > len(train_1)
  
      # should raise an exception when percentage is off bounds
      with pytest.raises(ValueError):
          result, logs = spatial_learning_curve_splitter(
              sample_data,
              train_percentages=[0.5, 1.1],
              space_column="space",
              time_column="time",
              training_limit="2015-09-09",
              holdout_gap=timedelta(days=180),
              random_state=0,
          )
      with pytest.raises(ValueError):
          result, logs = spatial_learning_curve_splitter(
              sample_data,
              train_percentages=[-0.1, 1.0],
              space_column="space",
              time_column="time",
              training_limit="2015-09-09",
              holdout_gap=timedelta(days=180),
              random_state=0,
          )
  
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 4 for calling a global function with example usage: test_spatial_learning_curve_splitter() without return types