code: def reverse_time_learning_curve_splitter(
      train_data: pd.DataFrame,
      time_column: str,
      training_time_limit: DateType,
      lower_time_limit: DateType = None,
      freq: str = "MS",
      holdout_gap: timedelta = timedelta(days=0),
      min_samples: int = 1000,
  ) -> SplitterReturnType:
      """
      Splits the data into temporal buckets given by the specified frequency.
      Uses a fixed out-of-ID and time hold out set for every fold.
      Training size increases per fold, with less recent data being added in each fold.
      Useful for inverse learning curve validation, that is, for seeing how hold out
      performance increases as the training size increases with less recent data.
  
      Parameters
      ----------
      train_data : pandas.DataFrame
          A Pandas' DataFrame that will be split inverse learning curve estimation.
  
      time_column : str
          The name of the Date column of `train_data`.
  
      training_time_limit : str
          The Date String for the end of the training period. Should be of the same
          format as `time_column`.
  
      lower_time_limit : str
          A Date String for the begining of the training period. This allows limiting
          the learning curve from bellow, avoiding heavy computation with very old data.
  
      freq : str
          The temporal frequency.
          See: http://pandas.pydata.org/pandas-docs/stable/timeseries.html#offset-aliases
  
      holdout_gap: datetime.timedelta
          Timedelta of the gap between the end of the training period and the start of the validation period.
  
      min_samples : int
          The minimum number of samples required in the split to keep the split.
      """
  
      train_data = train_data.reset_index()
      first_moment = (
          lower_time_limit
          if lower_time_limit
          else train_data[time_column].min()
      )
      date_range = pd.date_range(
          start=first_moment, end=training_time_limit, freq=freq
      )
  
      # training will end at last timestamp in range
      effective_training_time_end = date_range[-1]
  
      train_range = train_data[
          train_data[time_column] <= effective_training_time_end
      ]
      test_time = train_data[
          train_data[time_column]
          > (effective_training_time_end + holdout_gap)
      ][time_column]
  
      def date_filter_fn(date: DateType) -> pd.DataFrame:
          return train_range.loc[train_data[time_column] >= date]
  
      folds = _get_lc_folds(
          date_range[::-1],
          date_filter_fn,
          test_time,
          time_column,
          min_samples,
      )
  
      logs = list(map(_log_time_fold, folds))  # get fold logs
      folds_indexes = _lc_fold_to_indexes(
          folds
      )  # final formatting with idx
  
      return folds_indexes, logs
  
imports: import operator
  from datetime import datetime, timedelta
  from itertools import chain, repeat, starmap
  from typing import Callable, Iterable, List, Tuple, Union
  import numpy
  import pandas
  from sklearn.model_selection import GroupKFold, KFold, StratifiedKFold
  from sklearn.utils import check_random_state
  from toolz.curried import curry, partial, pipe, assoc, accumulate, map, filter
  from fklearn.common_docstrings import splitter_return_docstring
  from fklearn.types import DateType, LogType, SplitterReturnType
label_desc: Use image node_id 10 for calling a global function with example usage: reverse_time_learning_curve_splitter(train_data, time_column, training_time_limit, lower_time_limit, freq, holdout_gap, min_samples) and returns: folds_indexes,  logs, train_range