code: def double_crossvalidation_split_df(
      df, n_lags, n_forecasts, k, valid_pct, test_pct
  ):
      """Splits data in two sets of k folds for crossvalidation on validation and test data.
  
      Parameters
      ----------
          df : pd.DataFrame
              data
          n_lags : int
              identical to NeuralProphet
          n_forecasts : int
              identical to NeuralProphet
          k : int
              number of CV folds
          valid_pct : float
              percentage of overall samples to be in validation
          test_pct : float
              percentage of overall samples to be in test
  
      Returns
      -------
          tuple of k tuples [(folds_val, folds_test), …]
              elements same as :meth:`crossvalidation_split_df` returns
      """
      df, _, _, _ = prep_or_copy_df(df)
      if len(df["ID"].unique()) > 1:
          raise NotImplementedError(
              "double_crossvalidation_split_df not implemented for df with many time series"
          )
      fold_pct_test = float(test_pct) / k
      folds_test = crossvalidation_split_df(
          df,
          n_lags,
          n_forecasts,
          k,
          fold_pct=fold_pct_test,
          fold_overlap_pct=0.0,
      )
      df_train = folds_test[0][0]
      fold_pct_val = float(valid_pct) / k / (1.0 - test_pct)
      folds_val = crossvalidation_split_df(
          df_train,
          n_lags,
          n_forecasts,
          k,
          fold_pct=fold_pct_val,
          fold_overlap_pct=0.0,
      )
      return folds_val, folds_test
  
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 16 for calling a global function with example usage: double_crossvalidation_split_df(df, n_lags, n_forecasts, k, valid_pct, test_pct) and returns: folds_val,  folds_test