#NEWLINE# @ classmethod #NEWLINE# def create_signature( cls , method , base , params , consumer_secret , token_secret = '' ) : #NEWLINE# #INDENT# '\n        Returns HMAC-SHA1 signature\n        as specified at: http://oauth.net/core/1.0a/#rfc.section.9.2\n        \n        :param str method:\n            HTTP method of the request to be signed.\n            \n        :param str base:\n            Base URL of the request without query string an fragment.\n            \n        :param dict params:\n            Dictionary or list of tuples of the request parameters.\n            \n        :param str consumer_secret:\n            :attr:`.core.Consumer.secret`\n            \n        :param str token_secret:\n            Access token secret as specified in http://oauth.net/core/1.0a/#anchor3.\n        \n        :returns:\n            The signature string.\n        ' #NEWLINE# base_string = _create_base_string ( method , base , params ) #NEWLINE# key = cls . _create_key ( consumer_secret , token_secret ) #NEWLINE# hashed = hmac . new ( six . b ( key ) , base_string . encode ( 'utf-8' ) , hashlib . sha1 ) #NEWLINE# base64_encoded = binascii . b2a_base64 ( hashed . digest ( ) ) [ : ( - 1 ) ] #NEWLINE# return base64_encoded