human
Complete the below
def folds(documents=[], K=10, **kwargs):

    ''''Returns an iterator of K folds, where each fold is a (train, test)-tuple.
    For example, for 10-fold cross-validation, it yields 10 tuples,
    each with a different 9/10 training and 1/10 testing documents.'
    '''

Give me a the Python program you requested?
assistant
#Here is the Python program you requested.
    def chunks(iterable, n=10):
        a = list(iterable)
        i = 0
        j = 0
        for m in xrange(n):
            j = (i + len(a[m::n]))
            (yield a[i:j])
            i = j
    k = kwargs.get('k', K)
    d = list(chunks(documents, max(k, 2)))
    for holdout in xrange(k):
        (yield (list(chain(*(d[:holdout] + d[(holdout + 1):]))), d[holdout]))