code: def getLeastUsedCell(self, c):
      
      segmentsPerCell = numpy.zeros(self.cellsPerColumn, dtype='uint32')
      for i in range(self.cellsPerColumn):
        segmentsPerCell[i] = self.getNumSegmentsInCell(c,i)
  
      cellMinUsage = numpy.where(segmentsPerCell==segmentsPerCell.min())[0]
      # return cellMinUsage[0] # return the first cell with minimum usage
  
      # if multiple cells has minimum usage, randomly pick one
      self._random.getUInt32(len(cellMinUsage))
      return cellMinUsage[self._random.getUInt32(len(cellMinUsage))]
docs: For the least used cell in a column