#NEWLINE# @ staticmethod #NEWLINE# def _url_base64_encode( msg ) : #NEWLINE# #INDENT# '\n        Base64 encodes a string using the URL-safe characters specified by\n        Amazon.\n        ' #NEWLINE# msg_base64 = base64 . b64encode ( msg ) #NEWLINE# msg_base64 = msg_base64 . replace ( '+' , '-' ) #NEWLINE# msg_base64 = msg_base64 . replace ( '=' , '_' ) #NEWLINE# msg_base64 = msg_base64 . replace ( '/' , '~' ) #NEWLINE# return msg_base64