#NEWLINE# @ contextmanager #NEWLINE# def retry_count( self , retries ) : #NEWLINE# #INDENT# '\n        retry_count(retries)\n\n        Modifies the number of retries for the scope of the ``with``\n        statement (in the current thread).\n\n        Example::\n\n            with client.retry_count(10):\n                client.ping()\n        ' #NEWLINE# if ( not isinstance ( retries , int ) ) : #NEWLINE# #INDENT# raise TypeError ( 'retries must be an integer' ) #NEWLINE# #UNINDENT# ( old_retries , self . retries ) = ( self . retries , retries ) #NEWLINE# try : #NEWLINE# #INDENT# ( yield ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# self . retries = old_retries