#NEWLINE# def timer( self , key ) : #NEWLINE# #INDENT# 'Decorator to report timing for a function.\n        The decorator method is on this class instead of Stats to ensure that the\n        current Stats instance at method invocation time is used instead of the\n        Stats instance available at decoration time (which may be the no-op instance).\n        Args:\n            key (str): Name to report the timing with.\n        ' #NEWLINE# Stats . _check_key ( self ) #NEWLINE# def wrapper( fn ) : #NEWLINE# #INDENT# @ wraps ( fn ) #NEWLINE# def inner( * args , **kwargs ) : #NEWLINE# #INDENT# with self . stats ( ) . timer ( key ) : #NEWLINE# #INDENT# return fn ( * args , ** kwargs ) #NEWLINE# #UNINDENT# #UNINDENT# return inner #NEWLINE# #UNINDENT# return wrapper