import itertools


def get_hp_fold_iterator(hp_grid, num_folds):
    """ Create an iterator over all combinations of hyperparameters and folds
    """
    hp_grid = list(hp_grid)
    folds = list(range(num_folds))

    hp_fold_it = itertools.product(hp_grid, folds)
    hp_fold_it = list(hp_fold_it)
    
    return hp_fold_it