def parseUrl(url):
    """Return a dict containing scheme, netloc, url, params, query, fragment keys.

    query is a dict where the values are always lists. If the query key appears only
    once in the URL, the list will have a single value.

    """
    scheme, netloc, url, params, query, fragment = urllib.parse.urlparse(url)
    query_dict = {
        k: sorted(v) if len(v) > 1 else v[0]
        for k, v in list(urllib.parse.parse_qs(query).items())
    }
    return {
        'scheme': scheme,
        'netloc': netloc,
        'url': url,
        'params': params,
        'query': query_dict,
        'fragment': fragment,
    }
def parseUrl ( url ) : scheme , netloc , url , params , query , fragment = urllib . parse . urlparse ( url ) query_dict = { k : sorted ( v ) if len ( v ) > 1 else v [ 0 ] for k , v in list ( urllib . parse . parse_qs ( query ) . items ( ) ) } return { 'scheme' : scheme , 'netloc' : netloc , 'url' : url , 'params' : params , 'query' : query_dict , 'fragment' : fragment , }
Return a dict containing scheme, netloc, url, params, query, fragment keys.

    query is a dict where the values are always lists. If the query key appears only
    once in the URL, the list will have a single value.