RFC3986 normalize URL & Optionally removing url-query/fragment string

def normalize(url, strip=False):
    "RFC3986 normalize URL & Optionally removing url-query/fragment string"
    if strip:
        p = _urltools.parse(url)
        url = p.scheme + '://' + p.subdomain + p.domain + p.path
    return _urltools.normalize(url)