<s> import sys <EOL> try : <EOL> import urllib2 <EOL> import httplib <EOL> def non_recursive_http_error_auth_reqed ( self , authreq , host , req , headers ) : <EOL> authreq = headers . get ( authreq , None ) <EOL> if not hasattr ( self , '<STR_LIT>' ) : <EOL> self . retried = <NUM_LIT:0> <EOL> if self . retried > <NUM_LIT:5> : <EOL> raise urllib2 . HTTPError ( req . get_full_url ( ) , <NUM_LIT> , "<STR_LIT>" , <EOL> headers , None ) <EOL> else : <EOL> self . retried += <NUM_LIT:1> <EOL> if authreq : <EOL> mo = urllib2 . AbstractBasicAuthHandler . rx . search ( authreq ) <EOL> if mo : <EOL> scheme , quote , realm = mo . groups ( ) <EOL> if scheme . lower ( ) == '<STR_LIT>' : <EOL> return self . retry_http_basic_auth ( host , req , realm ) <EOL> urllib2 . AbstractBasicAuthHandler . http_error_auth_reqed = non_recursive_http_error_auth_reqed <EOL> if sys . version_info < ( <NUM_LIT:2> , <NUM_LIT:6> , <NUM_LIT:3> ) : <EOL> urllib2 . Request . _tunnel_host = None <EOL> def py268_set_proxy ( self , host , type ) : <EOL> if self . type == '<STR_LIT>' and not self . _tunnel_host : <EOL> self . _tunnel_host = self . host <EOL> else : <EOL> self . type = type <EOL> self . _Request__r_host = self . _Request__original <EOL> self . host = host <EOL> urllib2 . Request . set_proxy = py268_set_proxy <EOL> if sys . version_info < ( <NUM_LIT:2> , <NUM_LIT:6> , <NUM_LIT:5> ) : <EOL> def py268_set_tunnel ( self , host , port = None , headers = None ) : <EOL> """<STR_LIT>""" <EOL> self . _tunnel_host = host <EOL> self . _tunnel_port = port <EOL> if headers : <EOL> self . _tunnel_headers = headers <EOL> else : <EOL> self . _tunnel_headers . clear ( ) <EOL> httplib . HTTPConnection . _set_tunnel = py268_set_tunnel <EOL> except ( ImportError ) : <EOL> pass </s>
