def fromBase64(s):
 if (base64Pattern.match(s) is None):
  raise SASLIncorrectEncodingError()
 try:
  return b64decode(s)
 except Exception as e:
  raise SASLIncorrectEncodingError(str(e))

def fromBase64 ( s ) : if ( base64Pattern . match ( s ) is None ) : raise SASLIncorrectEncodingError ( ) try : return b64decode ( s ) except Exception as e : raise SASLIncorrectEncodingError ( str ( e ) )
decode base64 encoded string .