code: def _getSDRPairs(self, pairs, noise=None, includeRandomLocation=False):
      
      sensations = {}
      for col in xrange(self.numColumns):
        locationID, featureID = pairs[col]
  
        # generate random location if requested
        if includeRandomLocation:
          locationID = random.randint(0, self.numLocations-1)
          location = self.locations[col][locationID]
  
        # generate union of locations if requested
        elif isinstance(locationID, tuple):
          location = set()
          for idx in list(locationID):
            location = location | self.locations[col][idx]
        else:
          location = self.locations[col][locationID]
  
        # generate empty feature if requested
        if featureID == -1:
          feature = set()
        # generate union of features if requested
        elif isinstance(featureID, tuple):
          feature = set()
          for idx in list(featureID):
            feature = feature | self.features[col][idx]
        else:
          feature = self.features[col][featureID]
  
        if noise is not None:
          location = self._addNoise(location, noise, self.externalInputSize)
          feature = self._addNoise(feature, noise, self.sensorInputSize)
  
        sensations[col] = (location, feature)
  
      return sensations
docs: This method takes a list of (location, feature) index pairs (one pair per
      cortical column), and returns a sensation dict in the correct format,
      adding noise if necessary.