<s> """<STR_LIT>""" <EOL> import codecs , binascii <EOL> def uu_encode ( input , errors = '<STR_LIT:strict>' , filename = '<STR_LIT>' , mode = <NUM_LIT:0> <NUM_LIT> ) : <EOL> """<STR_LIT>""" <EOL> assert errors == '<STR_LIT:strict>' <EOL> from cStringIO import StringIO <EOL> from binascii import b2a_uu <EOL> infile = StringIO ( str ( input ) ) <EOL> outfile = StringIO ( ) <EOL> read = infile . read <EOL> write = outfile . write <EOL> write ( '<STR_LIT>' % ( mode & <NUM_LIT:0> <NUM_LIT> , filename ) ) <EOL> chunk = read ( <NUM_LIT> ) <EOL> while chunk : <EOL> write ( b2a_uu ( chunk ) ) <EOL> chunk = read ( <NUM_LIT> ) <EOL> write ( '<STR_LIT>' ) <EOL> return ( outfile . getvalue ( ) , len ( input ) ) <EOL> def uu_decode ( input , errors = '<STR_LIT:strict>' ) : <EOL> """<STR_LIT>""" <EOL> assert errors == '<STR_LIT:strict>' <EOL> from cStringIO import StringIO <EOL> from binascii import a2b_uu <EOL> infile = StringIO ( str ( input ) ) <EOL> outfile = StringIO ( ) <EOL> readline = infile . readline <EOL> write = outfile . write <EOL> while <NUM_LIT:1> : <EOL> s = readline ( ) <EOL> if not s : <EOL> raise ValueError , '<STR_LIT>' <EOL> if s [ : <NUM_LIT:5> ] == '<STR_LIT>' : <EOL> break <EOL> while <NUM_LIT:1> : <EOL> s = readline ( ) <EOL> if not s or s == '<STR_LIT>' : <EOL> break <EOL> try : <EOL> data = a2b_uu ( s ) <EOL> except binascii . Error , v : <EOL> nbytes = ( ( ( ord ( s [ <NUM_LIT:0> ] ) - <NUM_LIT:32> ) & <NUM_LIT> ) * <NUM_LIT:4> + <NUM_LIT:5> ) // <NUM_LIT:3> <EOL> data = a2b_uu ( s [ : nbytes ] ) <EOL> write ( data ) <EOL> if not s : <EOL> raise ValueError , '<STR_LIT>' <EOL> return ( outfile . getvalue ( ) , len ( input ) ) <EOL> class Codec ( codecs . Codec ) : <EOL> def encode ( self , input , errors = '<STR_LIT:strict>' ) : <EOL> return uu_encode ( input , errors ) <EOL> def decode ( self , input , errors = '<STR_LIT:strict>' ) : <EOL> return uu_decode ( input , errors ) <EOL> class IncrementalEncoder ( codecs . IncrementalEncoder ) : <EOL> def encode ( self , input , final = False ) : <EOL> return uu_encode ( input , self . errors ) [ <NUM_LIT:0> ] <EOL> class IncrementalDecoder ( codecs . IncrementalDecoder ) : <EOL> def decode ( self , input , final = False ) : <EOL> return uu_decode ( input , self . errors ) [ <NUM_LIT:0> ] <EOL> class StreamWriter ( Codec , codecs . StreamWriter ) : <EOL> pass <EOL> class StreamReader ( Codec , codecs . StreamReader ) : <EOL> pass <EOL> def getregentry ( ) : <EOL> return codecs . CodecInfo ( <EOL> name = '<STR_LIT>' , <EOL> encode = uu_encode , <EOL> decode = uu_decode , <EOL> incrementalencoder = IncrementalEncoder , <EOL> incrementaldecoder = IncrementalDecoder , <EOL> streamreader = StreamReader , <EOL> streamwriter = StreamWriter , <EOL> ) </s>
