def parse_query_string(query_string, encoding='utf-8'):
    query_dict = collections.defaultdict(list)
    for query_item in query_string.split('&'):
        if '=' not in query_item:
            continue
        keyword, value = query_item.split('=', 1)
        value = urllib.parse.unquote_plus(value)
        query_dict[keyword].append(to_text(value, encoding=encoding))
    return query_dict
dataset/ETHPy150Open mozillazg/bustard/bustard/utils.py/parse_query_string/original