def urlsafe_b64encode(s):
 return b64encode(s).translate(_urlsafe_encode_translation)

def urlsafe_b64encode ( s ) : return b64encode ( s ) . translate ( _urlsafe_encode_translation )
encode a string using a url-safe base64 alphabet .