code: def get_folds(
      cv, y
  ) -> Generator[Tuple[pd.Series, pd.Series], None, None]:
      """
      Returns the train and test indices for the time series data
      """
      # https://github.com/sktime/sktime/blob/main/examples/window_splitters.ipynb
      for train_indices, test_indices in cv.split(y):
          # print(f"Train Indices: {train_indices}, Test Indices: {test_indices}")
          yield train_indices, test_indices
  
imports: import time
  import warnings
  from collections import defaultdict
  from functools import partial
  from typing import Any, Dict, Generator, List, Optional, Tuple, Union
  import numpy
  import pandas
  from joblib import Parallel, delayed
  from scipy.stats import rankdata
  from sklearn.base import clone
  from sklearn.metrics._scorer import _PredictScorer
  from sklearn.model_selection import ParameterGrid, ParameterSampler, check_cv
  from sklearn.model_selection._validation import _aggregate_score_dicts
  from sktime.forecasting.compose import ForecastingPipeline
  from sktime.forecasting.model_selection import ExpandingWindowSplitter, SlidingWindowSplitter
  from sktime.utils.validation.forecasting import check_y_X
  from pycaret.internal.logging import get_logger
  from pycaret.utils.generic import _get_metrics_dict, get_function_params
  from pycaret.utils.time_series.forecasting import get_predictions_with_intervals, update_additional_scorer_kwargs
  from pycaret.utils.time_series.forecasting.pipeline import _get_imputed_data
label_desc: Use image node_id 1 for calling a global function with example usage: get_folds(cv, y) without return types