def parse_qs(s, rx, parsef=None, length=<NUM_LIT:2>, quote=False):
if type(rx) != str:<EOL><INDENT>rx = rx.pattern;<EOL><DEDENT>if re.match("<STR_LIT>", s):<EOL><INDENT>if not parsef:<EOL><INDENT>if parse_utuple(s,rx,length=length):<EOL><INDENT>if quote:<EOL><INDENT>s=quote_subs(s);<EOL><DEDENT>return evalt(s);<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>".format(<EOL>s, rx));<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return parsef(s,length=length);<EOL><DEDENT><DEDENT>elif re.match('<STR_LIT>'.format(rx), s):<EOL><INDENT>if quote:<EOL><INDENT>return eval('<STR_LIT>'.format(s));<EOL><DEDENT>return eval('<STR_LIT>'.format(s));<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>".format(<EOL>s,rx));<EOL><DEDENT>
helper for parsing a string that can both rx or parsef
       which is obstensibly the parsef for rx.

       Use parse colors for color tuples. This won't work with
       those.