code: def computePhase2(self, doLearn=False):
      
  
      # Phase 2: compute predicted state for each cell
      # - if a segment has enough horizontal connections firing because of
      #   bottomUpInput, it's set to be predicting, and we queue up the segment
      #   for reinforcement,
      # - if pooling is on, try to find the best weakly activated segment to
      #   reinforce it, else create a new pooling segment.
      for c in xrange(self.numberOfCols):
  
        buPredicted = False # whether any cell in the column is predicted
        for i in xrange(self.cellsPerColumn):
          # Iterate over each of the segments of this cell
          maxConfidence = 0
          for s in self.cells[c][i]:
  
            # sum(connected synapses) >= activationThreshold?
            if self.isSegmentActive(s, self.activeState['t']):
  
              self.predictedState['t'][c,i] = 1
              buPredicted = True
              maxConfidence = max(maxConfidence, s.dutyCycle(readOnly=True))
  
              if doLearn:
                s.totalActivations += 1    # increment activationFrequency
                s.lastActiveIteration = self.iterationIdx
                # mark this segment for learning
                activeUpdate = self.getSegmentActiveSynapses(c,i,s,'t')
                activeUpdate.phase1Flag = False
                self.addToSegmentUpdates(c, i, activeUpdate)
  
          # Store the max confidence seen among all the weak and strong segments
          #  as the cell's confidence.
          self.confidence['t'][c,i] = maxConfidence
docs: This is the phase 2 of learning, inference and multistep prediction. During
      this phase, all the cell with lateral support have their predictedState
      turned on and the firing segments are queued up for updates.
  
      Parameters:
      --------------------------------------------
      doLearn:      Boolean flag to queue segment updates during learning
      retval:       ?