<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def singletrial(num_trials, skipstep=1):
 """ Single-trial cross-validation schema Use one trial for training, all others for testing. Parameters num_trials : int Total number of trials skipstep : int only use every `skipstep` trial for training Returns ------- gen : generator object the generator returns tuples (trainset, testset) """

    for t in range(0, num_trials, skipstep):
        trainset = [t]
        testset = [i for i in range(trainset[0])] + \
                  [i for i in range(trainset[-1] + 1, num_trials)]
        testset = sort([t % num_trials for t in testset])
        yield trainset, testset