code: def get_cross_validation_datasets(
      dataset, n_folds=None, order=None, **kwargs
  ):
      """Creates a set of training/test splits for cross validation.
  
      This function generates ``n_folds`` splits of the given dataset. The first
      part of each split corresponds to the training dataset, while the second
      part to the test dataset. No pairs of test datasets share any examples, and
      all test datasets together cover the whole base dataset. Each test dataset
      contains almost same number of examples (the numbers may differ up to 1).
  
      Args:
          dataset: Dataset to split.
          n_fold(int): *(deprecated)*
              `n_fold` is now deprecated for consistency of naming choice.
              Please use `n_folds` instead.
          n_folds (int): Number of splits for cross validation.
          order (sequence of ints): Order of indexes with which each split is
              determined. If it is ``None``, then no permutation is used.
  
      Returns:
          list of tuples: List of dataset splits.
  
      """
  
      if "n_fold" in kwargs:
          warnings.warn(
              "Argument `n_fold` is deprecated. "
              "Please use `n_folds` instead",
              DeprecationWarning,
          )
          n_folds = kwargs["n_fold"]
      if order is None:
          order = numpy.arange(len(dataset))
      else:
          order = numpy.array(order)  # copy
  
      whole_size = len(dataset)
      borders = [
          whole_size * i // n_folds
          for i in six.moves.range(n_folds + 1)
      ]
      test_sizes = [
          borders[i + 1] - borders[i] for i in six.moves.range(n_folds)
      ]
  
      splits = []
      for test_size in reversed(test_sizes):
          size = whole_size - test_size
          splits.append(split_dataset(dataset, size, order))
          new_order = numpy.empty_like(order)
          new_order[:test_size] = order[-test_size:]
          new_order[test_size:] = order[:-test_size]
          order = new_order
  
      return splits
  
file_path: chainer/chainer/datasets/sub_dataset.py
imports: import numpy
  import six
  import warnings
  from chainer.dataset import dataset_mixin
label_desc: Use image node_id 5 for calling a global function with example usage: get_cross_validation_datasets(dataset, n_folds, order) and returns: splits