code: def apicalCheck(self, apicalInput):
      
      # Calculate predictions for this timestep
      (activeApicalSegments, matchingApicalSegments,
       apicalPotentialOverlaps) = self._calculateSegmentActivity(
         self.apicalConnections, apicalInput, self.connectedPermanence,
         self.activationThreshold, self.minThreshold, self.reducedBasalThreshold)
  
      apicallySupportedCells = self.apicalConnections.mapSegmentsToCells(
        activeApicalSegments)
  
      predictedCells = np.intersect1d(
        self.basalConnections.mapSegmentsToCells(self.activeBasalSegments),
        apicallySupportedCells)
  
      return predictedCells
docs: Return 'recent' apically predicted cells for each tick  of apical timer
      - finds active apical segments corresponding to predicted basal segment,
  
      @param apicalInput (numpy array)
      List of active input bits for the apical dendrite segments