def save_entity_cache(self, force=False):
    if force:
        self.x_queries_passed = self.save_every_x_queries
    self.x_queries_passed = (self.x_queries_passed + 1)
    if (self.x_queries_passed >= self.save_every_x_queries):
        with open(self.cache_path, 'wb') as f:
            pickle.dump(self.entity_cache, f)
        self.x_queries_passed = 0
def save_entity_cache(self, force=False):
    if force:
        self.x_queries_passed = self.save_every_x_queries
    self.x_queries_passed = (self.x_queries_passed + 1)
    if (self.x_queries_passed >= self.save_every_x_queries):
        with open(self.cache_path, 'wb') as f:
            pickle.dump(self.entity_cache, f)
        self.x_queries_passed = 0