code: def _adaptSynapses(self, inputVector, activeColumns, synPermActiveInc, synPermInactiveDec):
      
      inputIndices = numpy.where(inputVector > 0)[0]
      permChanges = numpy.zeros(self.getNumInputs(), dtype=REAL_DTYPE)
      permChanges.fill(-1 * synPermInactiveDec)
      permChanges[inputIndices] = synPermActiveInc
      perm = numpy.zeros(self.getNumInputs(), dtype=REAL_DTYPE)
      potential = numpy.zeros(self.getNumInputs(), dtype=REAL_DTYPE)
      for i in activeColumns:
        self.getPermanence(i, perm)
        self.getPotential(i, potential)
        maskPotential = numpy.where(potential > 0)[0]
        perm[maskPotential] += permChanges[maskPotential]
        self._updatePermanencesForColumn(perm, i, raisePerm=False)
docs: The primary method in charge of learning. Adapts the permanence values of
      the synapses based on the input vector, and the chosen columns after
      inhibition round. Permanence values are increased for synapses connected to
      input bits that are turned on, and decreased for synapses connected to
      inputs bits that are turned off.
  
      Parameters:
      ----------------------------
      @param inputVector:
                      A numpy array of 0's and 1's that comprises the input to
                      the spatial pooler. There exists an entry in the array
                      for every input bit.
      @param activeColumns:
                      An array containing the indices of the columns that
                      survived inhibition.
  
      @param synPermActiveInc:
                      Permanence increment for active inputs
      @param synPermInactiveDec:
                      Permanence decrement for inactive inputs