code: def _inhibitColumnsWithLateral(self, overlaps, lateralConnections):
      
      n,m = self.shape
      y   = np.zeros(n)
      s   = self.sparsity
      L   = lateralConnections
      desiredWeight = self.codeWeight
      inhSignal     = np.zeros(n)
      sortedIndices = np.argsort(overlaps, kind='mergesort')[::-1]
  
      currentWeight = 0
      for i in sortedIndices:
  
        if overlaps[i] < self._stimulusThreshold:
          break
  
        inhTooStrong = ( inhSignal[i] >= s )
  
        if not inhTooStrong:
          y[i]              = 1.
          currentWeight    += 1
          inhSignal[:]     += L[i,:]
  
        if self.enforceDesiredWeight and currentWeight == desiredWeight:
          break
  
      activeColumns = np.where(y==1.0)[0]
  
      return activeColumns
docs: Performs an experimentatl local inhibition. Local inhibition is 
      iteratively performed on a column by column basis.