(url, proxies)
return proxy
Select a proxy for the url, if applicable.

    :param url: The url being for the request
    :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs
Select a proxy for the url, if applicable.
Select a proxy for the url if applicable .
def select_proxy(url, proxies):
    """Select a proxy for the url, if applicable.

    :param url: The url being for the request
    :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs
    """
    proxies = proxies or {}
    urlparts = urlparse(url)
    proxy = proxies.get(urlparts.scheme+'://'+urlparts.hostname)
    if proxy is None:
        proxy = proxies.get(urlparts.scheme)
    return proxy
def select_proxy ( url , proxies ) : proxies = proxies or { } urlparts = urlparse ( url ) proxy = proxies . get ( urlparts . scheme + '://' + urlparts . hostname ) if proxy is None : proxy = proxies . get ( urlparts . scheme ) return proxy