def _buildSL2TrainingSet(self, numOnes=<NUM_LIT:10>, numRepetitions= <NUM_LIT:10>):
numPatterns = <NUM_LIT:5><EOL>numCols = <NUM_LIT:2> * numPatterns * numOnes<EOL>halfCols = numPatterns * numOnes<EOL>numNoiseBits = numOnes<EOL>p = self._getSimplePatterns(numOnes, numPatterns)<EOL>numSequences = <NUM_LIT:3><EOL>indices = [<EOL>[<NUM_LIT:0>, <NUM_LIT:1>, <NUM_LIT:2>, <NUM_LIT:3>, <NUM_LIT:4>],<EOL>[<NUM_LIT:4>, <NUM_LIT:3>, <NUM_LIT:2>, <NUM_LIT:1>, <NUM_LIT:0>],<EOL>[<NUM_LIT:2>, <NUM_LIT:0>, <NUM_LIT:4>, <NUM_LIT:1>, <NUM_LIT:3>],<EOL>]<EOL>trainingSequences = []<EOL>for i in range(numRepetitions*numSequences):<EOL><INDENT>sequence = []<EOL>for j in range(numPatterns):<EOL><INDENT>v = numpy.zeros(numCols, dtype='<STR_LIT>')<EOL>v[<NUM_LIT:0>:halfCols] = p[indices[i % numSequences][j]]<EOL>noiseIndices = (self._rgen.permutation(halfCols)<EOL>+ halfCols)[<NUM_LIT:0>:numNoiseBits]<EOL>v[noiseIndices] = <NUM_LIT:1><EOL>sequence.append(v)<EOL><DEDENT>trainingSequences.append(sequence)<EOL><DEDENT>testSequences = []<EOL>for i in range(numSequences):<EOL><INDENT>sequence = []<EOL>for j in range(numPatterns):<EOL><INDENT>v = numpy.zeros(numCols, dtype='<STR_LIT>')<EOL>v[<NUM_LIT:0>:halfCols] = p[indices[i % numSequences][j]]<EOL>sequence.append(v)<EOL><DEDENT>testSequences.append(sequence)<EOL><DEDENT>if g_options.verbosity > <NUM_LIT:1>:<EOL><INDENT>print("<STR_LIT>")<EOL>self._printAllTrainingSequences(trainingSequences)<EOL>print("<STR_LIT>")<EOL>self._printAllTrainingSequences(testSequences)<EOL><DEDENT>return (trainingSequences, testSequences)<EOL>
Three simple sequences, composed of the same 5 static patterns. The left
        half of the vector contains the pattern elements, each with numOnes
        consecutive bits. The right half contains numOnes random bits.

        Sequence 1 is: p0, p1, p2, p3, p4
        Sequence 2 is: p4, p3, p2, p1, p0
        Sequence 3 is: p2, p0, p4, p1, p3

        The function returns a pair:

        trainingSequences:    A list containing numRepetitions instances of the
                              above sequences
        testSequence:         Clean test sequences with no noise on the right half