code: def unfold_dict_of_folds(folds_dict, k):
      """Convert dict of folds for typical format of folding of train and test data.
  
      Parameters
      ----------
          folds_dict : dict
              dict of folds
          k : int
              number of folds initially set
  
      Returns
      -------
          list of k tuples [(df_train, df_val), ...]
  
              training data
  
              validation data
      """
      folds = []
      df_train = pd.DataFrame()
      df_test = pd.DataFrame()
      for j in range(0, k):
          for key in folds_dict:
              assert k == len(folds_dict[key])
              df_train = pd.concat(
                  (df_train, folds_dict[key][j][0]), ignore_index=True
              )
              df_test = pd.concat(
                  (df_test, folds_dict[key][j][1]), ignore_index=True
              )
          folds.append((df_train, df_test))
          df_train = pd.DataFrame()
          df_test = pd.DataFrame()
      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 13 for calling a global function with example usage: unfold_dict_of_folds(folds_dict, k) and returns: folds