#NEWLINE# def get_mac_signature( key , data , timestamp , nonce ) : #NEWLINE# #INDENT# '\n    Returns BASE64 ( HMAC-SHA1 (key, data) )\n    ' #NEWLINE# hashed = hmac . new ( str ( key ) , ( '%s %s %s' % ( timestamp , nonce , data ) ) , hashlib . sha1 ) #NEWLINE# return binascii . b2a_base64 ( hashed . digest ( ) ) [ : ( - 1 ) ]