#NEWLINE# def decode( bytes_sequence , encodings ) : #NEWLINE# #INDENT# 'Return the first successfully decoded string' #NEWLINE# for encoding in encodings : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# decoded = bytes_sequence . decode ( encoding ) #NEWLINE# return decoded #NEWLINE# #UNINDENT# except UnicodeDecodeError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# raise DecodeError