code: def updateSynapses(self, synapses, delta):
      
      reached0 = False
  
      if delta > 0:
        for synapse in synapses:
          self.syns[synapse][2] = newValue = self.syns[synapse][2] + delta
  
          # Cap synapse permanence at permanenceMax
          if newValue > self.tp.permanenceMax:
            self.syns[synapse][2] = self.tp.permanenceMax
  
      else:
        for synapse in synapses:
          self.syns[synapse][2] = newValue = self.syns[synapse][2] + delta
  
          # Cap min synapse permanence to 0 in case there is no global decay
          if newValue <= 0:
            self.syns[synapse][2] = 0
            reached0 = True
  
      return reached0
docs: Update a set of synapses in the segment.
  
      @param tp       The owner TP
      @param synapses List of synapse indices to update
      @param delta    How much to add to each permanence
  
      @returns   True if synapse reached 0