def save(self, doc):
        if doc.id:
            return self.update(doc)
        else:
            return self.insert(doc)
def __get_stop_condition(self):
        for covariance in self.__variances:
            if numpy.linalg.norm(covariance) == 0.0:
                return True