def parse_qs(qs, keep_blank_values=0, strict_parsing=0, keep_attr_order=True):
    od = DefaultOrderedDict(list) if keep_attr_order else defaultdict(list)
    for name, value in urlparse.parse_qsl(qs, keep_blank_values, strict_parsing):
        od[name].append(value)

    return od
Kind of like urlparse.parse_qs, except returns an ordered dict.
dataset/ETHPy150Open tanghaibao/jcvi/utils/orderedcollections.py/parse_qs