code: def _get_sc_test_fold_idx_and_logs(
      test_data: pd.DataFrame,
      train_time: pd.Series,
      time_column: str,
      first_test_moment: DateType,
      last_test_moment: DateType,
      min_samples: int,
      freq: str,
  ) -> Tuple[List[LogType], List[List[pd.Index]]]:
      periods_range = pd.period_range(
          start=first_test_moment, end=last_test_moment, freq=freq
      )
  
      def date_filter_fn(period: DateType) -> pd.DataFrame:
          return test_data[
              test_data[time_column].dt.to_period(freq) == period
          ]
  
      folds = _get_sc_folds(
          periods_range, date_filter_fn, time_column, min_samples
      )
  
      logs = list(
          map(_log_time_fold, zip(repeat(train_time), folds))
      )  # get fold logs
      test_indexes = list(
          map(lambda test: [test.index], folds)
      )  # final formatting with idx
      return logs, test_indexes
  
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 4 for calling a global function with example usage: _get_sc_test_fold_idx_and_logs(test_data, train_time, time_column, first_test_moment, last_test_moment, min_samples, freq) and returns: logs,  test_indexes, test_data