def clear(self):
        """Clears the cache."""
        if self._cache is None:
            return _NO_RESULTS
        if self._cache is not None:
            with self._cache as k:
                res = [x.as_operation() for x in k.values()]
                k.clear()
                k.out_deque.clear()
                return res
Clears the cache.