def uu_decode(input, errors='strict'):
 assert (errors == 'strict')
 from cStringIO import StringIO
 from binascii import a2b_uu
 infile = StringIO(str(input))
 outfile = StringIO()
 readline = infile.readline
 write = outfile.write
 while 1:
  s = readline()
  if (not s):
   raise ValueError, 'Missing "begin" line in input data'
  if (s[:5] == 'begin'):
   break
 while 1:
  s = readline()
  if ((not s) or (s == 'end\n')):
   break
  try:
   data = a2b_uu(s)
  except binascii.Error as v:
   nbytes = (((((ord(s[0]) - 32) & 63) * 4) + 5) / 3)
   data = a2b_uu(s[:nbytes])
  write(data)
 if (not s):
  raise ValueError, 'Truncated input data'
 return (outfile.getvalue(), len(input))

def uu_decode ( input , errors = 'strict' ) : assert ( errors == 'strict' ) from cStringIO import StringIO from binascii import a2b_uu infile = StringIO ( str ( input ) ) outfile = StringIO ( ) readline = infile . readline write = outfile . write while 1 : s = readline ( ) if ( not s ) : raise ValueError , 'Missing "begin" line in input data' if ( s [ : 5 ] == 'begin' ) : break while 1 : s = readline ( ) if ( ( not s ) or ( s == 'end\n' ) ) : break try : data = a2b_uu ( s ) except binascii . Error as v : nbytes = ( ( ( ( ( ord ( s [ 0 ] ) - 32 ) & 63 ) * 4 ) + 5 ) / 3 ) data = a2b_uu ( s [ : nbytes ] ) write ( data ) if ( not s ) : raise ValueError , 'Truncated input data' return ( outfile . getvalue ( ) , len ( input ) )
decodes the object input and returns a tuple .