def METHOD_NAME(cls, uri):
    parts = urlparse(uri)
    path = parts.path
    scheme = parts.scheme or None
    if parts.query:
        path += "?" + parts.query
    if parts.scheme and parts.netloc:
        path = parts.netloc + path
    parts = path.split('!')
    path = parts.pop() if parts else None
    archive = parts.pop() if parts else None
    return ParsedPath(path, archive, scheme)