generate_folds function

Generate cross-fitting and sample-splitting folds