#NEWLINE# def _checked_apply( aspects , function , module = None ) : #NEWLINE# #INDENT# logdebug ( '  applying aspects %s to function %s.' , aspects , function ) #NEWLINE# if callable ( aspects ) : #NEWLINE# #INDENT# wrapper = aspects ( wrapper ) #NEWLINE# assert callable ( wrapper ) , ( 'Aspect %s did not return a callable (it return %s).' % ( aspects , wrapper ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# wrapper = function #NEWLINE# for aspect in aspects : #NEWLINE# #INDENT# wrapper = aspect ( wrapper ) #NEWLINE# assert callable ( wrapper ) , ( 'Aspect %s did not return a callable (it return %s).' % ( aspect , wrapper ) ) #NEWLINE# #UNINDENT# #UNINDENT# return mimic ( wrapper , function , module = module )