<s> import sys <EOL> _ver = sys . version_info <EOL> is_py2 = ( _ver [ <NUM_LIT:0> ] == <NUM_LIT:2> ) <EOL> is_py3 = ( _ver [ <NUM_LIT:0> ] == <NUM_LIT:3> ) <EOL> if is_py2 : <EOL> from urllib import ( quote , unquote , quote_plus , unquote_plus , urlencode , <EOL> getproxies , proxy_bypass ) <EOL> from urlparse import urlparse , urlunparse , urljoin , urlsplit , urldefrag <EOL> from urllib2 import parse_http_list <EOL> import cookielib <EOL> from Cookie import Morsel <EOL> from StringIO import StringIO <EOL> from httplib import IncompleteRead <EOL> builtin_str = str <EOL> bytes = str <EOL> str = unicode <EOL> basestring = basestring <EOL> numeric_types = ( int , long , float ) <EOL> elif is_py3 : <EOL> from urllib . parse import ( urlparse , urlunparse , urljoin , urlsplit , <EOL> urlencode , quote , unquote , quote_plus , <EOL> unquote_plus , urldefrag ) <EOL> from urllib . request import parse_http_list , getproxies , proxy_bypass <EOL> from http import cookiejar as cookielib <EOL> from http . cookies import Morsel <EOL> from io import StringIO <EOL> from http . client import IncompleteRead <EOL> builtin_str = str <EOL> str = str <EOL> bytes = bytes <EOL> basestring = ( str , bytes ) <EOL> numeric_types = ( int , float ) <EOL> def python_2_unicode_compatible ( cls ) : <EOL> """<STR_LIT>""" <EOL> if not is_py3 : <EOL> cls . __unicode__ = cls . __str__ <EOL> cls . __str__ = lambda self : self . __unicode__ ( ) . encode ( '<STR_LIT:utf-8>' ) <EOL> return cls </s>
