Cleanup results to compute again with new votes
16485
protected function cleanupResult () : void
    {
        // Reset state
        if ($this->_State > 2) : 
            $this->_State = 2;
        endif;

            //////

        // Clean pairwise
        $this->_Pairwise = null;

        // Algos
        $this->_Calculator = null;
    }
573477
def cleanup(self):
        
        now = time.time()
        expired = now - NODE_TIMEOUT
        if self.conn.zremrangebyscore(self.key, 0, expired):
            self._notify()
921330
function done( error, results ) {
		if ( error ) {
			return clbk( error );
		}
		if ( results ) {
			return clbk( null, results );
		}
		clbk();
	}
1239907
void refreshResult() {

        String itemId = m_resultTable.getCurrentPageFirstItemId();
        CmsFileExplorerSettings state = m_resultTable.getTableSettings();
        search(
            m_resultFacets.getSelectedFieldFacets(),
            m_resultFacets.getSelectedRangeFactes(),
            m_textSearch.getValue());
        m_resultTable.setTableState(state);
        m_resultTable.updateSorting();
        m_resultTable.setCurrentPageFirstItemId(itemId);
    }
1170880
def deferred_cleanup(fn):
    """"""
    @functools.wraps(fn)
    def ret(*args, **kwargs):
        defers = []
        try:
            ret = fn(lambda *args: defers.extend(args), *args, **kwargs)
        finally:
            for defer in reversed(defers):
                defer()
        return ret
    return ret
868010
def process_results(self, results=None, **value):
        """"""
        for res in results:
            if 'mask' in res:
                res['mask'] = utils.IrcString(res['mask'])
            value['success'] = res.pop('retcode', None) != '486'
            value.update(res)
        return value
767407
def _cleanup(self):
        """"""
        if self.todolist.exists():
            try:
                saved_todo = iter(open(self.todolist, encoding="utf-8"))
                int(next(saved_todo).strip())
                for line in saved_todo:
                    _, serial = line.strip().split()
                    int(serial)
            except (StopIteration, ValueError):
                # The todo list was inconsistent. This may happen if we get
                # killed e.g. by the timeout wrapper. Just remove it - we'll
                # just have to do whatever happened since the last successful
                # sync.
                logger.info("Removing inconsistent todo list.")
                self.todolist.unlink()
625195
def add(self, new_results):
        
        for result in new_results:
            result.update(self.context)
            self.results = self.results.append(result, ignore_index=True)
196313
def _prepare_results(self, results):
        
        if self._instances:
            results = self._to_instances(results)
        else:
            results = list(results)

        # cache the len for future use
        self._len = len(results)

        return results
500680
def cancelAllPendingResults( self ):
        """"""
        for k in self._results.keys():
            rs = self._results[k]
            self._results[k] = [ j for j in rs if isinstance(j, dict) ]
        self._pending = dict()
1129170
def _cleanup(self):  # pragma: no cover
        
        need_to_delete = []  # can't delete from a dict while iterating
        with self.attr_lock:
            now_time = time()
            for path in self.cache:
                if now_time - self.attr[path][TIMESTAMP_KEY] >= MAX_CACHE_TIME:
                    need_to_delete.append(path)
            for path in need_to_delete:
                del self.attr[path]
                del self.cache[path]
989947
private void cleanup() {
        StatsDataReference ref = null;
        while ((ref = (StatsDataReference) statisticsReferenceQueue.poll()) != null) {
            StatsData oldStats = null;
            StatsData updatedStats = null;
            do {
                oldStats = terminatedThreadStats.get();
                updatedStats = aggregateStats(oldStats, ref.statsData);
            } while (!terminatedThreadStats.compareAndSet(oldStats, updatedStats));
            allReferences.remove(ref);
        }
    }
1255907
def clear(self, results=True, errors=True):
        '''
        
        '''
        if results:
            self.results = []
        if errors:
            self.errors = []
1284301
def cleanup(self):
        
        #First we *copy* the arrays that we currently have pointers to. This is not
        #the optimal solution; however, because of limitations in ctypes, we don't
        #know anything better at the moment.
        for key in self.result:
            self.result[key] = self.result[key].copy()

        #Now deallocate the pointers managed by Fortran in the shared library so that
        #any subsequent calls to the executable that generated this result creates
        #new instances in memory.
        for key in list(self._finalizers.keys()):
            self._finalizers[key].clean()
1197928
def _filtering_result_checked(self, by_or):
		''''''
		filters, results = it.imap(set, ( self.feed.filters.all(),
			self.filtering_results.values_list('filter', flat=True) ))

		# Check if conclusion can already be made, based on cached results.
		if results.issubset(filters):
			# If at least one failed/passed test is already there, and/or outcome is defined.
			try: return self._filtering_result(by_or)
			except IndexError: # inconclusive until results are consistent
				if filters == results: return not by_or

		# Consistency check / update.
		if filters != results:
			# Drop obsolete (removed, unbound from feed)
			#  filters' results (they WILL corrupt outcome).
			self.filtering_results.filter(filter__in=results.difference(filters)).delete()
			# One more try, now that results are only from feed filters' subset.
			try: return self._filtering_result(by_or)
			except IndexError: pass
			# Check if any filter-results are not cached yet, create them (perform actual filtering).
			# Note that independent filters applied first, since
			#  crossrefs should be more resource-hungry in general.
			for filter_obj in sorted(filters.difference(results), key=op.attrgetter('base.crossref')):
				filter_op = FilterResult(filter=filter_obj, post=self, result=filter_obj.handler(self))
				filter_op.save()
				if filter_op.result == by_or: return by_or # return as soon as first passed / failed

		# Final result
		try: return self._filtering_result(by_or)
		except IndexError: return not by_or
148498
void cleanUpStaleEntries() {
        for (KeyedRef<K, V> ref = q.poll(); ref != null; ref = q.poll()) {
            map.remove(ref.getKey(), ref); // CONCURRENT remove() operation
        }
    }
1106082
def executor_cleanup(self):
        """"""
        try:
            executor = self.get_executor(create=None)
        except AttributeError:
            pass
        else:
            if executor is not None:
                executor.cleanup()