#NEWLINE# def make_wrapper( func , how ) : #NEWLINE# #INDENT# @ functools . wraps ( func ) #NEWLINE# def wrapper( self , * args , **kwargs ) : #NEWLINE# #INDENT# results = object . __getattribute__ ( self , '_results' ) #NEWLINE# data = results . model . data #NEWLINE# if ( how and isinstance ( how , tuple ) ) : #NEWLINE# #INDENT# obj = data . wrap_output ( func ( results , * args , ** kwargs ) , how [ 0 ] , how [ 1 : ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if how : #NEWLINE# #INDENT# obj = data . wrap_output ( func ( results , * args , ** kwargs ) , how ) #NEWLINE# #UNINDENT# #UNINDENT# return obj #NEWLINE# #UNINDENT# argspec = inspect . getargspec ( func ) #NEWLINE# formatted = inspect . formatargspec ( argspec [ 0 ] , varargs = argspec [ 1 ] , defaults = argspec [ 3 ] ) #NEWLINE# func_name = get_function_name ( func ) #NEWLINE# wrapper . __doc__ = ( '%s%s\n%s' % ( func_name , formatted , wrapper . __doc__ ) ) #NEWLINE# return wrapper