def parse_qs(qs, keep_blank_values=0, strict_parsing=0, unquote=unquote):
    """
    like cgi.parse_qs, only with custom unquote function
    """
    d = {}
    items = [s2 for s1 in qs.split("&") for s2 in s1.split(";")]
    for item in items:
        try:
            k, v = item.split("=", 1)
        except ValueError:
            if strict_parsing:
                raise
            continue
        if v or keep_blank_values:
            k = unquote(k.replace("+", " "))
            v = unquote(v.replace("+", " "))
            if k in d:
                d[k].append(v)
            else:
                d[k] = [v]
    return d
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/web/http.py/parse_qs/original