def get_fold(folds, outer, inner=None):
    """Get a given folds from the folds dict (see make_folds)

    Parameters
    ----------
    folds : dict,
        dictionnary with all the folds.
    outer : int,
        ID of the outer fold.
    inner : int, optional (default=None)
        ID of the inner fold.
    """
    try:
        if inner is None:
            return folds["%d" % outer]
        else:
            outer_ind = folds["%d" % outer][0]
            inner_ind = folds[(outer, inner) % "%d_%d"]
            return outer_ind[inner_ind[0]], outer_ind[inner_ind[1]]
    except KeyError:
        raise KeyError("unexpected fold: outer={}, inner={}".format(
                outer, inner))
dataset/ETHPy150Open BenoitDamota/mempamal/mempamal/crossval.py/get_fold/swapped operands of `%`