code: def test_timegapsplit_with_a_gap():
      gap_duration = timedelta(days=2)
      cv_gap = TimeGapSplit(
          date_serie=df["date"],
          train_duration=timedelta(days=5),
          valid_duration=timedelta(days=3),
          gap_duration=gap_duration,
      )
  
      for i, indices in enumerate(cv_gap.split(X_train, y_train)):
          train_mindate = df.loc[X_train.iloc[indices[0]].index][
              "date"
          ].min()
          train_maxdate = df.loc[X_train.iloc[indices[0]].index][
              "date"
          ].max()
          valid_mindate = df.loc[X_train.iloc[indices[1]].index][
              "date"
          ].min()
          valid_maxdate = df.loc[X_train.iloc[indices[1]].index][
              "date"
          ].max()
  
          assert (
              train_mindate
              <= train_maxdate
              <= valid_mindate
              <= valid_maxdate
          )
          assert valid_mindate - train_maxdate >= gap_duration
  
file_path: scikit-lego/tests/test_model_selection/test_timegapsplit.py
imports: import datetime
  from datetime import timedelta
  import numpy
  import pandas
  import pytest
  from sklearn.linear_model import Lasso
  from sklearn.model_selection import GridSearchCV
  from sklearn.pipeline import Pipeline
  from sklego.model_selection import TimeGapSplit
label_desc: Use image node_id 7 for calling a global function with example usage: test_timegapsplit_with_a_gap() without return types