#NEWLINE# def request( self , url , method = 'GET' , * args , **kwargs ) : #NEWLINE# #INDENT# kwargs . setdefault ( 'headers' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# if ( self . setting ( 'VERIFY_SSL' ) is not None ) : #NEWLINE# #INDENT# kwargs . setdefault ( 'verify' , self . setting ( 'VERIFY_SSL' ) ) #NEWLINE# #UNINDENT# kwargs . setdefault ( 'timeout' , ( self . setting ( 'REQUESTS_TIMEOUT' ) or self . setting ( 'URLOPEN_TIMEOUT' ) ) ) #NEWLINE# if ( self . SEND_USER_AGENT and ( 'User-Agent' not in kwargs [ 'headers' ] ) ) : #NEWLINE# #INDENT# kwargs [ 'headers' ] [ 'User-Agent' ] = user_agent ( ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# if self . SSL_PROTOCOL : #NEWLINE# #INDENT# session = SSLHttpAdapter . ssl_adapter_session ( self . SSL_PROTOCOL ) #NEWLINE# response = session . request ( method , url , * args , ** kwargs ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# response = request ( method , url , * args , ** kwargs ) #NEWLINE# #UNINDENT# #UNINDENT# except ConnectionError as err : #NEWLINE# #INDENT# raise AuthFailed ( self , str ( err ) ) #NEWLINE# #UNINDENT# response . raise_for_status ( ) #NEWLINE# return response