#NEWLINE# def execute( self ) : #NEWLINE# #INDENT# raw = self . build ( ) #NEWLINE# if ( self . api . cache and self . cacheable and self . api . cache . exists ( self . signature ) ) : #NEWLINE# #INDENT# response = self . api . cache . get ( raw ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# self . _wait ( ) #NEWLINE# response = self . endpoint . get ( ** raw ) . execute ( ) #NEWLINE# #UNINDENT# except Exception as err : #NEWLINE# #INDENT# if isinstance ( err , TypeError ) : #NEWLINE# #INDENT# width = max ( map ( len , self . raw . keys ( ) ) ) #NEWLINE# raw = [ ( key . ljust ( width ) , value ) for ( key , value ) in self . raw . items ( ) ] #NEWLINE# parameters = utils . paste ( raw , '\t' , '\n' ) #NEWLINE# diagnostics = utils . format ( '\n                        {message}\n\n                        The query you submitted was:\n\n                        {parameters}\n                        ' , message = str ( err ) , parameters = parameters ) #NEWLINE# raise errors . InvalidRequestError ( diagnostics ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise err #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( self . api . cache and err . cacheable ) : #NEWLINE# #INDENT# self . api . cache . set ( raw , response ) #NEWLINE# #UNINDENT# return Report ( response , self )