#NEWLINE# def delete( self , key ) : #NEWLINE# #INDENT# ' Delete `key` from cache. Also deletes all responses from response history\n        ' #NEWLINE# try : #NEWLINE# #INDENT# if ( key in self . responses ) : #NEWLINE# #INDENT# ( response , _ ) = self . responses [ key ] #NEWLINE# del self . responses [ key ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( response , _ ) = response . responses [ self . keys_map [ key ] ] #NEWLINE# del self . keys_map [ key ] #NEWLINE# #UNINDENT# for r in response . history : #NEWLINE# #INDENT# del self . keys_map [ self . create_key ( r . request ) ] #NEWLINE# #UNINDENT# #UNINDENT# except KeyError : #NEWLINE# #INDENT# pass