code: def _crossvalidation_split_df(
      df, n_lags, n_forecasts, k, fold_pct, fold_overlap_pct=0.0
  ):
      """Splits data in k folds for crossvalidation.
  
      Parameters
      ----------
          df : pd.DataFrame
              data
          n_lags : int
              identical to NeuralProphet
          n_forecasts : int
              identical to NeuralProphet
          k : int
              number of CV folds
          fold_pct : float
              percentage of overall samples to be in each fold
          fold_overlap_pct : float
              percentage of overlap between the validation folds (default: 0.0)
  
      Returns
      -------
          list of k tuples [(df_train, df_val), ...]
  
              training data
  
              validation data
      """
      # Receives df with single ID column
      assert len(df["ID"].unique()) == 1
      if n_lags == 0:
          assert n_forecasts == 1
      total_samples = len(df) - n_lags + 2 - (2 * n_forecasts)
      samples_fold = max(1, int(fold_pct * total_samples))
      samples_overlap = int(fold_overlap_pct * samples_fold)
      assert samples_overlap < samples_fold
      min_train = (
          total_samples
          - samples_fold
          - (k - 1) * (samples_fold - samples_overlap)
      )
      assert min_train >= samples_fold
      folds = []
      df_fold = df.copy(deep=True)
      for i in range(k, 0, -1):
          df_train, df_val = split_df(
              df_fold,
              n_lags,
              n_forecasts,
              valid_p=samples_fold,
              inputs_overbleed=True,
          )
          folds.append((df_train, df_val))
          split_idx = len(df_fold) - samples_fold + samples_overlap
          df_fold = df_fold.iloc[:split_idx].reset_index(drop=True)
      folds = folds[::-1]
      return folds
  
imports: from __future__ import annotations
  import logging
  import math
  from collections import OrderedDict
  from dataclasses import dataclass
  from typing import TYPE_CHECKING, List, Optional, Tuple
  import numpy
  import pandas
label_desc: Use image node_id 11 for calling a global function with example usage: _crossvalidation_split_df(df, n_lags, n_forecasts, k, fold_pct, fold_overlap_pct) and returns: folds