@contextlib.contextmanager
def profiling():
 profile_start()
 (yield)
 profile_stop()

@ contextlib . contextmanager def profiling ( ) : profile_start ( ) ( yield ) profile_stop ( )
context manager that enables profiling on entry and disables profiling on exit .