def get_fold_val(fold_test, fold_list):
    """ Get the validation fold given the test fold.

    Useful for cross-validation evaluation mode.

    Return the next fold in a circular way.
    e.g. if the fold_list is ['fold1', 'fold2',...,'fold10'] and
    the fold_test is 'fold1', then return 'fold2'.
    If the fold_test is 'fold10', return 'fold1'.

    Parameters
    ----------
    fold_test : str
        Fold used for model testing.
    fold_list : list of str
        Fold list.

    Returns
    -------
    str
        Validation fold.

    """
    N_folds = len(fold_list)
    fold_test_ix = [k for k, v in enumerate(fold_list) if v == fold_test][0]
    # sum(divmod(fold_test_ix+1,N_folds))
    fold_val_ix = (fold_test_ix+1) % N_folds
    fold_val = fold_list[fold_val_ix]
    return fold_val