#NEWLINE# def __call__( self , * args , **kw ) : #NEWLINE# #INDENT# obj = args [ 0 ] #NEWLINE# try : #NEWLINE# #INDENT# cache = obj . __cache #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# cache = obj . __cache = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# key = ( res . func , args [ 1 : ] , frozenset ( kw . items ( ) ) ) #NEWLINE# try : #NEWLINE# #INDENT# res = cache [ key ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# res = cache [ key ] = self . func ( * args , ** kw ) #NEWLINE# #UNINDENT# return res