<s> """<STR_LIT>""" <EOL> import codecs , sys <EOL> encode = codecs . utf_16_encode <EOL> def decode ( input , errors = '<STR_LIT:strict>' ) : <EOL> return codecs . utf_16_decode ( input , errors , True ) <EOL> class IncrementalEncoder ( codecs . IncrementalEncoder ) : <EOL> def __init__ ( self , errors = '<STR_LIT:strict>' ) : <EOL> codecs . IncrementalEncoder . __init__ ( self , errors ) <EOL> self . encoder = None <EOL> def encode ( self , input , final = False ) : <EOL> if self . encoder is None : <EOL> result = codecs . utf_16_encode ( input , self . errors ) [ <NUM_LIT:0> ] <EOL> if sys . byteorder == '<STR_LIT>' : <EOL> self . encoder = codecs . utf_16_le_encode <EOL> else : <EOL> self . encoder = codecs . utf_16_be_encode <EOL> return result <EOL> return self . encoder ( input , self . errors ) [ <NUM_LIT:0> ] <EOL> def reset ( self ) : <EOL> codecs . IncrementalEncoder . reset ( self ) <EOL> self . encoder = None <EOL> def getstate ( self ) : <EOL> return ( <NUM_LIT:2> if self . encoder is None else <NUM_LIT:0> ) <EOL> def setstate ( self , state ) : <EOL> if state : <EOL> self . encoder = None <EOL> else : <EOL> if sys . byteorder == '<STR_LIT>' : <EOL> self . encoder = codecs . utf_16_le_encode <EOL> else : <EOL> self . encoder = codecs . utf_16_be_encode <EOL> class IncrementalDecoder ( codecs . BufferedIncrementalDecoder ) : <EOL> def __init__ ( self , errors = '<STR_LIT:strict>' ) : <EOL> codecs . BufferedIncrementalDecoder . __init__ ( self , errors ) <EOL> self . decoder = None <EOL> def _buffer_decode ( self , input , errors , final ) : <EOL> if self . decoder is None : <EOL> ( output , consumed , byteorder ) = codecs . utf_16_ex_decode ( input , errors , <NUM_LIT:0> , final ) <EOL> if byteorder == - <NUM_LIT:1> : <EOL> self . decoder = codecs . utf_16_le_decode <EOL> elif byteorder == <NUM_LIT:1> : <EOL> self . decoder = codecs . utf_16_be_decode <EOL> elif consumed >= <NUM_LIT:2> : <EOL> raise UnicodeError ( "<STR_LIT>" ) <EOL> return ( output , consumed ) <EOL> return self . decoder ( input , self . errors , final ) <EOL> def reset ( self ) : <EOL> codecs . BufferedIncrementalDecoder . reset ( self ) <EOL> self . decoder = None <EOL> class StreamWriter ( codecs . StreamWriter ) : <EOL> def __init__ ( self , stream , errors = '<STR_LIT:strict>' ) : <EOL> codecs . StreamWriter . __init__ ( self , stream , errors ) <EOL> self . encoder = None <EOL> def reset ( self ) : <EOL> codecs . StreamWriter . reset ( self ) <EOL> self . encoder = None <EOL> def encode ( self , input , errors = '<STR_LIT:strict>' ) : <EOL> if self . encoder is None : <EOL> result = codecs . utf_16_encode ( input , errors ) <EOL> if sys . byteorder == '<STR_LIT>' : <EOL> self . encoder = codecs . utf_16_le_encode <EOL> else : <EOL> self . encoder = codecs . utf_16_be_encode <EOL> return result <EOL> else : <EOL> return self . encoder ( input , errors ) <EOL> class StreamReader ( codecs . StreamReader ) : <EOL> def reset ( self ) : <EOL> codecs . StreamReader . reset ( self ) <EOL> try : <EOL> del self . decode <EOL> except AttributeError : <EOL> pass <EOL> def decode ( self , input , errors = '<STR_LIT:strict>' ) : <EOL> ( object , consumed , byteorder ) = codecs . utf_16_ex_decode ( input , errors , <NUM_LIT:0> , False ) <EOL> if byteorder == - <NUM_LIT:1> : <EOL> self . decode = codecs . utf_16_le_decode <EOL> elif byteorder == <NUM_LIT:1> : <EOL> self . decode = codecs . utf_16_be_decode <EOL> elif consumed >= <NUM_LIT:2> : <EOL> raise UnicodeError , "<STR_LIT>" <EOL> return ( object , consumed ) <EOL> def getregentry ( ) : <EOL> return codecs . CodecInfo ( <EOL> name = '<STR_LIT>' , <EOL> encode = encode , <EOL> decode = decode , <EOL> incrementalencoder = IncrementalEncoder , <EOL> incrementaldecoder = IncrementalDecoder , <EOL> streamreader = StreamReader , <EOL> streamwriter = StreamWriter , <EOL> ) </s>
