#NEWLINE# def profile_cpu_bound_program( ) : #NEWLINE# #INDENT# real_dog = DogStatsApi ( ) #NEWLINE# real_dog . reporter = NullReporter ( ) #NEWLINE# fake_dog = NullDogStatsApi ( ) #NEWLINE# for ( type_ , dog ) in [ ( 'real' , real_dog ) , ( 'fake' , fake_dog ) ] : #NEWLINE# #INDENT# print ( ( '\n\n\nTESTING %s\n\n' % type_ ) ) #NEWLINE# dog . start ( ) #NEWLINE# program = CPUBoundProgram ( type_ ) #NEWLINE# yappi . start ( ) #NEWLINE# program . run ( ) #NEWLINE# yappi . print_stats ( sort_type = yappi . SORTTYPE_TSUB , sort_order = yappi . SORTORDER_DESC ) #NEWLINE# yappi . stop ( ) #NEWLINE# yappi . clear_stats ( )