#NEWLINE# def __call__( self , fn ) : #NEWLINE# #INDENT# import_deps = self . import_deps #NEWLINE# spec = compat . inspect_getfullargspec ( fn ) #NEWLINE# spec_zero = list ( spec [ 0 ] ) #NEWLINE# hasself = ( spec_zero [ 0 ] in ( 'self' , 'cls' ) ) #NEWLINE# for i in range ( len ( import_deps ) ) : #NEWLINE# #INDENT# spec [ 0 ] [ ( i + ( 1 if hasself else 0 ) ) ] = ( 'import_deps[%r]' % i ) #NEWLINE# #UNINDENT# inner_spec = format_argspec_plus ( spec , grouped = False ) #NEWLINE# for impname in import_deps : #NEWLINE# #INDENT# del spec_zero [ ( 1 if hasself else 0 ) ] #NEWLINE# #UNINDENT# spec [ 0 ] [ : ] = spec_zero #NEWLINE# outer_spec = format_argspec_plus ( spec , grouped = False ) #NEWLINE# code = ( 'lambda %(args)s: fn(%(apply_kw)s)' % { #NEWLINE# #INDENT# 'args' : outer_spec [ 'args' ] , #NEWLINE# 'apply_kw' : inner_spec [ 'apply_kw' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# decorated = eval ( code , locals ( ) ) #NEWLINE# decorated . __defaults__ = getattr ( fn , 'im_func' , fn ) . __defaults__ #NEWLINE# return update_wrapper ( decorated , fn )