(proxy)
return scheme, user, password, hostport
Return (scheme, user, password, host/port) given a URL or an authority.

    If a URL is supplied, it must have an authority (host:port) component.
    According to RFC 3986, having an authority component means the URL must
    have two slashes after the scheme.
Return (scheme, user, password, host/port) given a URL or an authority.
Return ( scheme user password host / port ) given a URL or an authority .
def _parse_proxy(proxy):
    """Return (scheme, user, password, host/port) given a URL or an authority.

    If a URL is supplied, it must have an authority (host:port) component.
    According to RFC 3986, having an authority component means the URL must
    have two slashes after the scheme.
    """
    scheme, r_scheme = _splittype(proxy)
    if not r_scheme.startswith("/"):
        # authority
        scheme = None
        authority = proxy
    else:
        # URL
        if not r_scheme.startswith("//"):
            raise ValueError("proxy URL with no authority: %r" % proxy)
        # We have an authority, so for RFC 3986-compliant URLs (by ss 3.
        # and 3.3.), path is empty or starts with '/'
        if '@' in r_scheme:
            host_separator = r_scheme.find('@')
            end = r_scheme.find("/", host_separator)
        else:
            end = r_scheme.find("/", 2)
        if end == -1:
            end = None
        authority = r_scheme[2:end]
    userinfo, hostport = _splituser(authority)
    if userinfo is not None:
        user, password = _splitpasswd(userinfo)
    else:
        user = password = None
    return scheme, user, password, hostport
def _parse_proxy ( proxy ) : scheme , r_scheme = _splittype ( proxy ) if not r_scheme . startswith ( "/" ) : # authority scheme = None authority = proxy else : # URL if not r_scheme . startswith ( "//" ) : raise ValueError ( "proxy URL with no authority: %r" % proxy ) # We have an authority, so for RFC 3986-compliant URLs (by ss 3. # and 3.3.), path is empty or starts with '/' if '@' in r_scheme : host_separator = r_scheme . find ( '@' ) end = r_scheme . find ( "/" , host_separator ) else : end = r_scheme . find ( "/" , 2 ) if end == - 1 : end = None authority = r_scheme [ 2 : end ] userinfo , hostport = _splituser ( authority ) if userinfo is not None : user , password = _splitpasswd ( userinfo ) else : user = password = None return scheme , user , password , hostport