parameters: (url, proxies)
return_statement: return proxy
docstring: 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
docstring_summary: Select a proxy for the url, if applicable.
docstring_tokens: Select a proxy for the url if applicable .
function: 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)
      if urlparts.hostname is None:
          return proxies.get(urlparts.scheme, proxies.get('all'))
  
      proxy_keys = [
          urlparts.scheme + '://' + urlparts.hostname,
          urlparts.scheme,
          'all://' + urlparts.hostname,
          'all',
      ]
      proxy = None
      for proxy_key in proxy_keys:
          if proxy_key in proxies:
              proxy = proxies[proxy_key]
              break
  
      return proxy
function_tokens: def select_proxy ( url , proxies ) : proxies = proxies or { } urlparts = urlparse ( url ) if urlparts . hostname is None : return proxies . get ( urlparts . scheme , proxies . get ( 'all' ) ) proxy_keys = [ urlparts . scheme + '://' + urlparts . hostname , urlparts . scheme , 'all://' + urlparts . hostname , 'all' , ] proxy = None for proxy_key in proxy_keys : if proxy_key in proxies : proxy = proxies [ proxy_key ] break return proxy