#NEWLINE# def decode( self , response , request ) : #NEWLINE# #INDENT# '\n        Parse the base64-encoded, colon-separated username and password into a\n        L{credentials.UsernamePassword} instance.\n        ' #NEWLINE# try : #NEWLINE# #INDENT# creds = binascii . a2b_base64 ( ( response + b'===' ) ) #NEWLINE# #UNINDENT# except binascii . Error : #NEWLINE# #INDENT# raise error . LoginFailed ( 'Invalid credentials' ) #NEWLINE# #UNINDENT# creds = creds . split ( b':' , 1 ) #NEWLINE# if ( len ( creds ) == 2 ) : #NEWLINE# #INDENT# return credentials . UsernamePassword ( * creds ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise error . LoginFailed ( 'Invalid credentials' )