def _learnPhase1(self, activeColumns, readOnly=False):
<EOL>self.lrnActiveState['<STR_LIT:t>'].fill(<NUM_LIT:0>)<EOL>numUnpredictedColumns = <NUM_LIT:0><EOL>for c in activeColumns:<EOL><INDENT>predictingCells = numpy.where(self.lrnPredictedState['<STR_LIT>'][c] == <NUM_LIT:1>)[<NUM_LIT:0>]<EOL>numPredictedCells = len(predictingCells)<EOL>assert numPredictedCells <= <NUM_LIT:1><EOL>if numPredictedCells == <NUM_LIT:1>:<EOL><INDENT>i = predictingCells[<NUM_LIT:0>]<EOL>self.lrnActiveState['<STR_LIT:t>'][c, i] = <NUM_LIT:1><EOL>continue<EOL><DEDENT>numUnpredictedColumns += <NUM_LIT:1><EOL>if readOnly:<EOL><INDENT>continue<EOL><DEDENT>i, s, numActive = self._getBestMatchingCell(<EOL>c, self.lrnActiveState['<STR_LIT>'], self.minThreshold)<EOL>if s is not None and s.isSequenceSegment():<EOL><INDENT>if self.verbosity >= <NUM_LIT:4>:<EOL><INDENT>print("<STR_LIT>", c)<EOL><DEDENT>self.lrnActiveState['<STR_LIT:t>'][c, i] = <NUM_LIT:1><EOL>segUpdate = self._getSegmentActiveSynapses(<EOL>c, i, s, self.lrnActiveState['<STR_LIT>'], newSynapses = True)<EOL>s.totalActivations += <NUM_LIT:1><EOL>trimSegment = self._adaptSegment(segUpdate)<EOL>if trimSegment:<EOL><INDENT>self._trimSegmentsInCell(c, i, [s], minPermanence = <NUM_LIT>,<EOL>minNumSyns = <NUM_LIT:0>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>i = self._getCellForNewSegment(c)<EOL>if (self.verbosity >= <NUM_LIT:4>):<EOL><INDENT>print("<STR_LIT>", c, end='<STR_LIT:U+0020>')<EOL>print("<STR_LIT>", i)<EOL><DEDENT>self.lrnActiveState['<STR_LIT:t>'][c, i] = <NUM_LIT:1><EOL>segUpdate = self._getSegmentActiveSynapses(<EOL>c, i, None, self.lrnActiveState['<STR_LIT>'], newSynapses=True)<EOL>segUpdate.sequenceSegment = True <EOL>self._adaptSegment(segUpdate)  <EOL><DEDENT><DEDENT>numBottomUpColumns = len(activeColumns)<EOL>if numUnpredictedColumns < numBottomUpColumns / <NUM_LIT:2>:<EOL><INDENT>return True   <EOL><DEDENT>else:<EOL><INDENT>return False<EOL><DEDENT>
Compute the learning active state given the predicted state and
the bottom-up input.

:param activeColumns list of active bottom-ups
:param readOnly      True if being called from backtracking logic.
                     This tells us not to increment any segment
                     duty cycles or queue up any updates.
:returns: True if the current input was sufficiently predicted, OR
         if we started over on startCells. False indicates that the current
         input was NOT predicted, well enough to consider it as "inSequence"

This looks at:
    - @ref lrnActiveState['t-1']
    - @ref lrnPredictedState['t-1']

This modifies:
    - @ref lrnActiveState['t']
    - @ref lrnActiveState['t-1']