def uriparse(uri, strict=False):
    key = uri, strict
    try:
        scheme, authority, path, q, fragment = _parse_cache[key]
        return (scheme, authority, path, q.copy(), fragment)
    except KeyError:
        pass
    if len(_parse_cache) >= MAX_CACHE_SIZE:
        _parse_cache.clear()
    if strict:
        mo = URI_RE_STRICT.search(uri)
        if mo:
            _, scheme, _, authority, path, _, query, _, fragment = mo.groups()
        else:
            raise ValueError("Invalid URI: %r" % (uri,))
    else:
        mo = URI_RE.search(uri)
        if mo:
            _, scheme, authority, path, _, query, _, fragment = mo.groups()
        else:
            raise ValueError("Invalid URI: %r" % (uri,))
    if query:
        q = queryparse(query)
    else:
        q = URLQuery()
    t = (scheme, authority, path, q, fragment)
    _parse_cache[key] = (scheme, authority, path, q.copy(), fragment)
    return (scheme, authority, path, q, fragment)
Given a valid URI, return a 5-tuple of (scheme, authority, path,
dataset/ETHPy150Open kdart/pycopia/aid/pycopia/urlparse.py/uriparse