def _rewrite(self, tostore):
        if self.__len__() > 0:
            for key in self.keys():
                try:
                    tostore.update(key, self.__getitem__(key))
                except __HOLE__:
                    logging.error("Inconsistent data for %s, ignoring." % key)
                self.__delitem__(key)
            tostore.flush()
dataset/ETHPy150Open yinhm/datafeed/datafeed/datastore.py/MinuteSnapshotCache._rewrite