def sum(self, weights=None):
        """ return the sum of weights of each object """
        if weights is None:
            weights = self.data.weights
        return utils.bincount(self.labels, weights, self.N)
def sum ( self , weights = None ) : if weights is None : weights = self . data . weights return utils . bincount ( self . labels , weights , self . N )
return the sum of weights of each object