def _should_use_proxy(url, no_proxy=None):
 if (no_proxy is None):
  no_proxy_effective = os.environ.get('no_proxy', '')
 else:
  no_proxy_effective = no_proxy
 urlObj = urlparse_.urlparse(_url_as_string(url))
 for np in [h.strip() for h in no_proxy_effective.split(',')]:
  if (urlObj.hostname == np):
   return False
 return True

def _should_use_proxy ( url , no_proxy = None ) : if ( no_proxy is None ) : no_proxy_effective = os . environ . get ( 'no_proxy' , '' ) else : no_proxy_effective = no_proxy urlObj = urlparse_ . urlparse ( _url_as_string ( url ) ) for np in [ h . strip ( ) for h in no_proxy_effective . split ( ',' ) ] : if ( urlObj . hostname == np ) : return False return True
determines whether a proxy should be used to open a connection to the specified url .