<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def createRandomObjects(self, numObjects, numPoints, numLocations=None, numFeatures=None):
 """ Creates a set of random objects and adds them to the machine. If numLocations and numFeatures and not specified, they will be set to the desired number of points. """

    if numObjects > 0:
      if numLocations is None:
        numLocations = numPoints
      if numFeatures is None:
        numFeatures = numPoints

      assert(numPoints <= numLocations), ("Number of points in object cannot be "
            "greater than number of locations")

      locationArray = numpy.array(range(numLocations))
      numpy.random.seed(self.seed)
      for _ in xrange(numObjects):
        # Permute the number of locations and select points from it
        locationArray = numpy.random.permutation(locationArray)
        self.addObject(
          [(locationArray[p],
            numpy.random.randint(0, numFeatures)) for p in xrange(numPoints)],
        )