Empty the cache and optionally invoke item_evicted callback.
511548
def clear(self, omit_item_evicted=False):
        """"""
        if not omit_item_evicted:
            items = self._dict.items()
            for key, value in items:
                self._evict_item(key, value)
        self._dict.clear()
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]
52376
def clear_cache():
        """"""
        del Cache._keys
        for k in list(Cache._cache.keys()):
            it = Cache._cache.pop(k)
            del it
        del Cache._cache
        Cache._keys = []
        Cache._cache = {}
        gc.collect()
254731
def remove(self, items):
        """"""
        # Remove the ack ID from lease management, and decrement the
        # byte counter.
        for item in items:
            if self._leased_messages.pop(item.ack_id, None) is not None:
                self._bytes -= item.byte_size
            else:
                _LOGGER.debug("Item %s was not managed.", item.ack_id)

        if self._bytes < 0:
            _LOGGER.debug("Bytes was unexpectedly negative: %d", self._bytes)
            self._bytes = 0
844456
public function purge() {
        // Get all files from the cache folder
        $contents = glob($this->_storage_path . '*');

        // Remove cache files
        foreach ($contents as $content) {
            if (is_file($content)) {
                unlink($content);
            }
        }
    }
949564
private void cleanup() {
		CacheEntry oldest = null;
		_count = 0;

		// Cleanup obsolete entries and find the oldest
		for (Map.Entry<String, CacheEntry> e : _cache.entrySet()) {
			String key = e.getKey();
			CacheEntry entry = e.getValue();
			// Remove obsolete entry
			if (entry.isExpired()) {
				_cache.remove(key);
			}
			// Count the remaining entry
			else {
				_count++;
				if (oldest == null || oldest.getExpiration() > entry.getExpiration())
					oldest = entry;
			}
		}

		// Remove the oldest if cache size exceeded maximum
		if (_count > _maxSize && oldest != null) {
			_cache.remove(oldest.getKey());
			_count--;
		}
	}
822592
public void clear()
    {
        Iterator it = cachesByClass.values().iterator();
        while (it.hasNext())
        {
            ObjectCache cache = (ObjectCache) it.next();
            if (cache != null)
            {
                cache.clear();
            }
        }
    }
1295371
def purge_cache(self):
        
        if len(self._cache) > self.max_cache_size:
            items = sorted(self._cache.items(), key=lambda (k, v): v['expiry'])
            self._cache = {k: v for k, v in items[self.max_cache_size:]
                           if not self._expired(v)}
739515
public void clear ()
    {
        for (int icount = _items.size(); icount > 0; icount--) {
            DirtyItem item = _items.remove(0);
            item.clear();
            _freelist.add(item);
        }
    }
699493
def _flush(self):
        
        self.classes_names = None
        self.__cache_methods = None
        self.__cached_methods_idx = None
        self.__cache_fields = None

        # cache methods and fields as well, otherwise the decompiler is quite slow
        self.__cache_all_methods = None
        self.__cache_all_fields = None
216566
def invalidate_all(self):
        
        for fname in os.listdir(self.cache_path):
            if fname.startswith(self.func.__name__ + "."):
                os.remove(os.path.join(self.cache_path, fname))
1260127
def _cleanup(self):
        '''
        
        '''
        self._declare_cb = None
        self._bind_cb = None
        self._unbind_cb = None
        self._delete_cb = None
        self._purge_cb = None
        super(QueueClass, self)._cleanup()
1080435
def clear(self, key):
        # type: (Hashable) -> DataLoader
        
        cache_key = self.get_cache_key(key)
        self._promise_cache.pop(cache_key, None)
        return self
768901
public void clear() {
        fullyLock();
        try {
            for (Node<E> p, h = head; (p = h.next) != null; h = p) {
                h.next = sentinel();
                p.item = null;
            }
            head = last;
            // assert head.item == null && head.next == null;
            if (count.getAndSet(0) == capacity)
                notFull.signal();
        } finally {
            fullyUnlock();
        }
    }
703512
public final void clear() {
        items.clear();
        iconCount = 0;
        dividerCount = 0;

        if (rawItems != null) {
            rawItems.clear();
        }

        notifyOnDataSetChanged();
    }
222885
private synchronized void clean() {
		
		while (checkOverFlow()) {

			List<CacheObject> cacheObjectList = sort();

			if (cacheObjectList != null && cacheObjectList.size() > 0) {
				CacheObject cacheObject = (CacheObject) cacheObjectList.get(0);
				remove(cacheObject.getKey());
			}
		}
	}
305064
def evict(self):
        """"""
        logging.debug('Evicting cache for %r', self.cache_key)
        _clear_version_cache(self.cache_key)
        # Cause the cache key to be refreshed next time any operation is
        # run to make sure we don't act on old cached data.
        self.versioned_cache_key = None