code: def _checkObjectsToLearn(self, objects):
      
      for objectName, sensationList in objects.iteritems():
        if objectName not in self.objects:
          raise ValueError(
            "Invalid object name \"{}\" sent to experiment".format(objectName)
          )
  
        for sensations in sensationList:
          if set(sensations.keys()) != set(range(self.numColumns)):
            raise ValueError(
              "Invalid number of cortical column sensations sent to experiment"
            )
          for pair in sensations.values():
            if not isinstance(pair, tuple) or len(pair) != 2 or \
                    not isinstance(pair[0], set) or \
                    not isinstance(pair[1], set):
              raise ValueError("Invalid SDR's sent to experiment")
docs: Checks that objects have the correct format before being sent to the
      experiment.