#NEWLINE# def unquote( s ) : #NEWLINE# #INDENT# "unquote('abc%20def') -> 'abc def'." #NEWLINE# res = s . split ( '%' ) #NEWLINE# for i in xrange ( 1 , len ( res ) ) : #NEWLINE# #INDENT# item = res [ i ] #NEWLINE# try : #NEWLINE# #INDENT# res [ i ] = ( _hextochr [ item [ : 2 ] ] + item [ 2 : ] ) #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# res [ i ] = ( '%' + item ) #NEWLINE# #UNINDENT# #UNINDENT# return '' . join ( res )