#NEWLINE# def get_encoding( name ) : #NEWLINE# #INDENT# '\n    Returns an Encoder object for the named encoding\n    ' #NEWLINE# try : #NEWLINE# #INDENT# return __encodings [ name . lower ( ) ] ( ) #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# msg = "Invalid encoding: '{}'" . format ( name ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# msg = 'Invalid encoding' #NEWLINE# #UNINDENT# raise EncodingException ( msg )