#NEWLINE# def expire( self , age ) : #NEWLINE# #INDENT# 'Expire any items in the cache older than `age` seconds' #NEWLINE# now = time . time ( ) #NEWLINE# cache = self . _acquire_cache ( ) #NEWLINE# expired = [ k for ( k , v ) in cache . iteritems ( ) if ( ( now - v [ 0 ] ) > age ) ] #NEWLINE# for k in expired : #NEWLINE# #INDENT# if ( k in cache ) : #NEWLINE# #INDENT# del cache [ k ] #NEWLINE# #UNINDENT# if ( k in self . store ) : #NEWLINE# #INDENT# del self . store [ k ] #NEWLINE# #UNINDENT# #UNINDENT# self . _write_cache ( cache )