(url, scheme='', allow_fragments=True)
return _coerce_result(v)
Parse a URL into 5 components:
    <scheme>://<netloc>/<path>?<query>#<fragment>

    The result is a named 5-tuple with fields corresponding to the
    above. It is either a SplitResult or SplitResultBytes object,
    depending on the type of the url parameter.

    The username, password, hostname, and port sub-components of netloc
    can also be accessed as attributes of the returned object.

    The scheme argument provides the default value of the scheme
    component when no scheme is found in url.

    If allow_fragments is False, no attempt is made to separate the
    fragment component from the previous component, which can be either
    path or query.

    Note that % escapes are not expanded.
Parse a URL into 5 components:
    <scheme>://<netloc>/<path>?<query>#<fragment>
Parse a URL into 5 components : <scheme > : // <netloc > / <path > ?<query > #<fragment >
def urlsplit(url, scheme='', allow_fragments=True):
    """Parse a URL into 5 components:
    <scheme>://<netloc>/<path>?<query>#<fragment>

    The result is a named 5-tuple with fields corresponding to the
    above. It is either a SplitResult or SplitResultBytes object,
    depending on the type of the url parameter.

    The username, password, hostname, and port sub-components of netloc
    can also be accessed as attributes of the returned object.

    The scheme argument provides the default value of the scheme
    component when no scheme is found in url.

    If allow_fragments is False, no attempt is made to separate the
    fragment component from the previous component, which can be either
    path or query.

    Note that % escapes are not expanded.
    """

    url, scheme, _coerce_result = _coerce_args(url, scheme)

    for b in _UNSAFE_URL_BYTES_TO_REMOVE:
        url = url.replace(b, "")
        scheme = scheme.replace(b, "")

    allow_fragments = bool(allow_fragments)
    key = url, scheme, allow_fragments, type(url), type(scheme)
    cached = _parse_cache.get(key, None)
    if cached:
        return _coerce_result(cached)
    if len(_parse_cache) >= MAX_CACHE_SIZE: # avoid runaway growth
        clear_cache()
    netloc = query = fragment = ''
    i = url.find(':')
    if i > 0:
        for c in url[:i]:
            if c not in scheme_chars:
                break
        else:
            scheme, url = url[:i].lower(), url[i+1:]

    if url[:2] == '//':
        netloc, url = _splitnetloc(url, 2)
        if (('[' in netloc and ']' not in netloc) or
                (']' in netloc and '[' not in netloc)):
            raise ValueError("Invalid IPv6 URL")
    if allow_fragments and '#' in url:
        url, fragment = url.split('#', 1)
    if '?' in url:
        url, query = url.split('?', 1)
    _checknetloc(netloc)
    v = SplitResult(scheme, netloc, url, query, fragment)
    _parse_cache[key] = v
    return _coerce_result(v)
def urlsplit ( url , scheme = '' , allow_fragments = True ) : url , scheme , _coerce_result = _coerce_args ( url , scheme ) for b in _UNSAFE_URL_BYTES_TO_REMOVE : url = url . replace ( b , "" ) scheme = scheme . replace ( b , "" ) allow_fragments = bool ( allow_fragments ) key = url , scheme , allow_fragments , type ( url ) , type ( scheme ) cached = _parse_cache . get ( key , None ) if cached : return _coerce_result ( cached ) if len ( _parse_cache ) >= MAX_CACHE_SIZE : # avoid runaway growth clear_cache ( ) netloc = query = fragment = '' i = url . find ( ':' ) if i > 0 : for c in url [ : i ] : if c not in scheme_chars : break else : scheme , url = url [ : i ] . lower ( ) , url [ i + 1 : ] if url [ : 2 ] == '//' : netloc , url = _splitnetloc ( url , 2 ) if ( ( '[' in netloc and ']' not in netloc ) or ( ']' in netloc and '[' not in netloc ) ) : raise ValueError ( "Invalid IPv6 URL" ) if allow_fragments and '#' in url : url , fragment = url . split ( '#' , 1 ) if '?' in url : url , query = url . split ( '?' , 1 ) _checknetloc ( netloc ) v = SplitResult ( scheme , netloc , url , query , fragment ) _parse_cache [ key ] = v return _coerce_result ( v )