def get_environ_proxies(url):
 get_proxy = (lambda k: (os.environ.get(k) or os.environ.get(k.upper())))
 no_proxy = get_proxy('no_proxy')
 netloc = urlparse(url).netloc
 if no_proxy:
  no_proxy = no_proxy.split(',')
  for host in no_proxy:
   if (netloc.endswith(host) or netloc.split(':')[0].endswith(host)):
    return {}
 if proxy_bypass(netloc):
  return {}
 return getproxies()

def get_environ_proxies ( url ) : get_proxy = ( lambda k : ( os . environ . get ( k ) or os . environ . get ( k . upper ( ) ) ) ) no_proxy = get_proxy ( 'no_proxy' ) netloc = urlparse ( url ) . netloc if no_proxy : no_proxy = no_proxy . split ( ',' ) for host in no_proxy : if ( netloc . endswith ( host ) or netloc . split ( ':' ) [ 0 ] . endswith ( host ) ) : return { } if proxy_bypass ( netloc ) : return { } return getproxies ( )
return a dict of environment proxies .