#NEWLINE# def expects_func_args( * args ) : #NEWLINE# #INDENT# def _decorator_checker( dec ) : #NEWLINE# #INDENT# @ functools . wraps ( dec ) #NEWLINE# def _decorator( f ) : #NEWLINE# #INDENT# base_f = safe_utils . get_wrapped_function ( f ) #NEWLINE# ( arg_names , a , kw , _default ) = inspect . getargspec ( base_f ) #NEWLINE# if ( a or kw or ( set ( args ) <= set ( arg_names ) ) ) : #NEWLINE# #INDENT# return dec ( f ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise TypeError ( ( 'Decorated function %(f_name)s does not have the arguments expected by the decorator %(d_name)s' % { #NEWLINE# #INDENT# 'f_name' : base_f . __name__ , #NEWLINE# 'd_name' : dec . __name__ , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# #UNINDENT# #UNINDENT# return _decorator #NEWLINE# #UNINDENT# return args