code: def learn(self, objects):
      
      self.setLearning(True)
  
      for objectName, sensationList in objects.iteritems():
        self.sendReset()
        print "Learning :", objectName
  
        prevLoc = [None] * self.numColumns
        numFeatures = len(sensationList[0])
        displacement = [0] * self.dimensions
  
        for sensation in xrange(numFeatures):
          for col in xrange(self.numColumns):
            location = np.array(sensationList[col][sensation][0])
            feature = sensationList[col][sensation][1]
  
            # Compute displacement from previous location
            if prevLoc[col] is not None:
              displacement = location - prevLoc[col]
            prevLoc[col] = location
  
            # learn each pattern multiple times
            for _ in xrange(self.repeat):
              # Sense feature at location
              self.motorInput[col].addDataToQueue(displacement)
              self.sensorInput[col].addDataToQueue(feature, False, 0)
              # Only move to the location on the first sensation.
              displacement = [0] * self.dimensions
  
        self.network.run(self.repeat * numFeatures)
  
        # update L2 representations for the object
        self.learnedObjects[objectName] = self.getL2Representations()
docs: Learns all provided objects
  
      :param objects: dict mapping object name to array of sensations, where each
                      sensation is composed of location and feature SDR for each
                      column. For example:
                      {'obj1' : [[[1,1,1],[101,205,523, ..., 1021]],...], ...}
                      Note: Each column must have the same number of sensations as
                      the other columns.
      :type objects: dict[str, array]