#NEWLINE# def client_request( self , client , method , url , **kwargs ) : #NEWLINE# #INDENT# "Send an http request using `client`'s endpoint and specified `url`.\n\n        If request was rejected as unauthorized (possibly because the token is\n        expired), issue one authorization attempt and send the request once\n        again.\n\n        :param client: instance of BaseClient descendant\n        :param method: method of HTTP request\n        :param url: URL of HTTP request\n        :param kwargs: any other parameter that can be passed to\n            `HTTPClient.request`\n        " #NEWLINE# ( token , endpoint ) = ( self . cached_token , client . cached_endpoint ) #NEWLINE# if ( not ( token and endpoint ) ) : #NEWLINE# #INDENT# ( token , endpoint ) = self . auth_plugin . token_and_endpoint ( ) #NEWLINE# self . cached_token = token #NEWLINE# client . cached_endpoint = endpoint #NEWLINE# #UNINDENT# if endpoint : #NEWLINE# #INDENT# kwargs . setdefault ( 'headers' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) [ 'Authorization' ] = ( 'Bearer %s' % token ) #NEWLINE# #UNINDENT# return self . request ( method , self . concat_url ( endpoint , url ) , ** kwargs )