def parse_qs(string):
result = {}<EOL>for item in split_qs(string):<EOL><INDENT>try:<EOL><INDENT>key, value = split_qs(item, delimiter='<STR_LIT:=>')<EOL><DEDENT>except ValueError:<EOL><INDENT>result[item] = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>result[key] = value<EOL><DEDENT><DEDENT>return result<EOL>
Intelligently parse the query string