<s> try : <EOL> TEXT = unicode <EOL> except NameError : <EOL> PY3 = True <EOL> TEXT = str <EOL> STRING_TYPES = ( str , bytes ) <EOL> def b ( x , encoding = '<STR_LIT:ascii>' ) : <EOL> return bytes ( x , encoding ) <EOL> else : <EOL> PY3 = False <EOL> STRING_TYPES = ( unicode , bytes ) <EOL> def b ( x , encoding = '<STR_LIT:ascii>' ) : <EOL> if isinstance ( x , unicode ) : <EOL> x = x . encode ( encoding ) <EOL> return x <EOL> def u ( x , encoding = '<STR_LIT:ascii>' ) : <EOL> if isinstance ( x , TEXT ) : <EOL> return x <EOL> try : <EOL> return x . decode ( encoding ) <EOL> except AttributeError : <EOL> raise ValueError ( '<STR_LIT>' % x ) <EOL> try : <EOL> import urlparse <EOL> except ImportError : <EOL> from urllib . parse import parse_qs <EOL> from urllib . parse import parse_qsl <EOL> from urllib . parse import quote <EOL> from urllib . parse import unquote <EOL> from urllib . parse import unquote_to_bytes <EOL> from urllib . parse import urlencode <EOL> from urllib . parse import urlsplit <EOL> from urllib . parse import urlunsplit <EOL> from urllib . parse import urlparse <EOL> from urllib . parse import urlunparse <EOL> else : <EOL> from urlparse import parse_qs <EOL> from urlparse import parse_qsl <EOL> from urllib import quote <EOL> from urllib import unquote <EOL> from urllib import urlencode <EOL> from urlparse import urlsplit <EOL> from urlparse import urlunsplit <EOL> from urlparse import urlparse <EOL> from urlparse import urlunparse <EOL> unquote_to_bytes = unquote </s>
