<s> """<STR_LIT>""" <EOL> import time <EOL> from . import context <EOL> class Timer ( object ) : <EOL> def __init__ ( self , context , key ) : <EOL> self . context = context <EOL> self . key = key <EOL> self . start_time = time . time ( ) <EOL> def __enter__ ( self ) : <EOL> return self <EOL> def __exit__ ( self , * args , ** kwargs ) : <EOL> self . context . set ( self . key , time . time ( ) - self . start_time ) <EOL> def timeit ( key ) : <EOL> return Timer ( context . current_context ( ) , key ) </s>
