folds function

Generate a list of index for the n-fold cross-validation