def buildAlternatingTrainingSet(numOnes=5):
 numPatterns = 14
 p = getSimplePatterns(numOnes, numPatterns)
 s1 = [p[0], p[1], p[0], p[1], p[0], p[2]]
 s2 = [p[0], p[1], p[0], p[1], p[3], p[4]]
 s3 = [p[0], p[1], p[5], p[6], p[7], p[8]]
 s4 = [p[0], p[9], p[10], p[11], p[12], p[13]]
 trainingSequences = [s1, s2, s3, s4]
 return (trainingSequences, 5)

def buildAlternatingTrainingSet ( numOnes = 5 ) : numPatterns = 14 p = getSimplePatterns ( numOnes , numPatterns ) s1 = [ p [ 0 ] , p [ 1 ] , p [ 0 ] , p [ 1 ] , p [ 0 ] , p [ 2 ] ] s2 = [ p [ 0 ] , p [ 1 ] , p [ 0 ] , p [ 1 ] , p [ 3 ] , p [ 4 ] ] s3 = [ p [ 0 ] , p [ 1 ] , p [ 5 ] , p [ 6 ] , p [ 7 ] , p [ 8 ] ] s4 = [ p [ 0 ] , p [ 9 ] , p [ 10 ] , p [ 11 ] , p [ 12 ] , p [ 13 ] ] trainingSequences = [ s1 , s2 , s3 , s4 ] return ( trainingSequences , 5 )
high order sequences that alternate elements .