def _DecodeUrlSafe(urlsafe):
 if (not isinstance(urlsafe, basestring)):
  raise TypeError(('urlsafe must be a string; received %r' % urlsafe))
 if isinstance(urlsafe, unicode):
  urlsafe = urlsafe.encode('utf8')
 mod = (len(urlsafe) % 4)
 if mod:
  urlsafe += ('=' * (4 - mod))
 return base64.b64decode(urlsafe.replace('-', '+').replace('_', '/'))

def _DecodeUrlSafe ( urlsafe ) : if ( not isinstance ( urlsafe , basestring ) ) : raise TypeError ( ( 'urlsafe must be a string; received %r' % urlsafe ) ) if isinstance ( urlsafe , unicode ) : urlsafe = urlsafe . encode ( 'utf8' ) mod = ( len ( urlsafe ) % 4 ) if mod : urlsafe += ( '=' * ( 4 - mod ) ) return base64 . b64decode ( urlsafe . replace ( '-' , '+' ) . replace ( '_' , '/' ) )
decode a url-safe base64-encoded string .