'Clear the cache until it shrinks to the requested size.
This does not completely wipe the cache, just makes sure it is under
the after_cleanup_count.'

def cleanup(self):

    while (len(self._cache) > self._after_cleanup_count):
        self._remove_lru()
