#NEWLINE# def sign_request( self , signature_method , consumer , token ) : #NEWLINE# #INDENT# 'Set the signature parameter to the result of sign.' #NEWLINE# if ( 'oauth_consumer_key' not in signature_method ) : #NEWLINE# #INDENT# self [ 'oauth_consumer_key' ] = consumer . key #NEWLINE# #UNINDENT# if ( token and ( 'oauth_token' not in self ) ) : #NEWLINE# #INDENT# self [ 'oauth_token' ] = token . key #NEWLINE# #UNINDENT# self [ 'oauth_signature_method' ] = signature_method . name #NEWLINE# self [ 'oauth_signature' ] = signature_method . sign ( self , consumer , token )