code: def test_cv():
      def check_folds(
          df,
          n_lags,
          n_forecasts,
          valid_fold_num,
          valid_fold_pct,
          fold_overlap_pct,
      ):
          folds = df_utils.crossvalidation_split_df(
              df,
              n_lags,
              n_forecasts,
              valid_fold_num,
              valid_fold_pct,
              fold_overlap_pct,
          )
          train_folds_len = []
          val_folds_len = []
          for f_train, f_val in folds:
              train_folds_len.append(len(f_train))
              val_folds_len.append(len(f_val))
          train_folds_samples = [
              x - n_lags - n_forecasts + 1 for x in train_folds_len
          ]
          val_folds_samples = [
              x - n_lags - n_forecasts + 1 for x in val_folds_len
          ]
          total_samples = len(df) - n_lags - (2 * n_forecasts) + 2
          val_fold_each = max(1, int(total_samples * valid_fold_pct))
          overlap_each = int(fold_overlap_pct * val_fold_each)
          assert all([x == val_fold_each for x in val_folds_samples])
          train_folds_should = [
              total_samples
              - val_fold_each
              - (valid_fold_num - i - 1)
              * (val_fold_each - overlap_each)
              for i in range(valid_fold_num)
          ]
          assert all(
              [
                  x == y
                  for (x, y) in zip(
                      train_folds_samples, train_folds_should
                  )
              ]
          )
  
      len_df = 100
      check_folds(
          df=pd.DataFrame(
              {
                  "ds": pd.date_range(
                      start="2017-01-01", periods=len_df
                  ),
                  "y": np.arange(len_df),
              }
          ),
          n_lags=0,
          n_forecasts=1,
          valid_fold_num=3,
          valid_fold_pct=0.1,
          fold_overlap_pct=0.0,
      )
      len_df = 1000
      check_folds(
          df=pd.DataFrame(
              {
                  "ds": pd.date_range(
                      start="2017-01-01", periods=len_df
                  ),
                  "y": np.arange(len_df),
              }
          ),
          n_lags=50,
          n_forecasts=10,
          valid_fold_num=10,
          valid_fold_pct=0.1,
          fold_overlap_pct=0.5,
      )
  
imports: import logging
  import os
  import pathlib
  import matplotlib.pyplot
  import numpy
  import pandas
  import pytest
  from torch.utils.data import DataLoader
  from neuralprophet import NeuralProphet, configure, df_utils, time_dataset
  from neuralprophet.data.process import _create_dataset, _handle_missing_data
  from neuralprophet.data.transform import _normalize
label_desc: Use image node_id 7 for calling a global function with example usage: test_cv() without return types