def _kwargs_to_qs(**kwargs):
<EOL>inpOptDef = inputs_options_defaults()<EOL>opts = {<EOL>name: dct['<STR_LIT:value>']<EOL>for name, dct in inpOptDef.items()<EOL>}<EOL>for k, v in kwargs.items():<EOL><INDENT>if k.lower() in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>del kwargs[k]<EOL>kwargs['<STR_LIT>'] = v<EOL><DEDENT>if k == '<STR_LIT>':<EOL><INDENT>if v.startswith('<STR_LIT>'):<EOL><INDENT>kwargs[k] = utils.rel_url_to_id(v)<EOL><DEDENT><DEDENT>if isinstance(v, bool):<EOL><INDENT>kwargs[k] = '<STR_LIT:Y>' if v else '<STR_LIT:N>'<EOL><DEDENT>if k.lower() in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>del kwargs[k]<EOL>kwargs['<STR_LIT>'] = v<EOL><DEDENT>if k.lower() in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>del kwargs[k]<EOL>if k.lower() == '<STR_LIT>':<EOL><INDENT>kwargs['<STR_LIT>'] = int(v)<EOL><DEDENT>else:<EOL><INDENT>kwargs['<STR_LIT>'] = int(v)<EOL><DEDENT><DEDENT>if k.lower() in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>del kwargs[k]<EOL>if k.lower() == '<STR_LIT>':<EOL><INDENT>kwargs['<STR_LIT>'] = int(v)<EOL><DEDENT>else:<EOL><INDENT>kwargs['<STR_LIT>'] = int(v)<EOL><DEDENT><DEDENT>if k.lower() in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>del kwargs[k]<EOL>if isinstance(v, collections.Iterable):<EOL><INDENT>lst = list(v)<EOL>kwargs['<STR_LIT>'] = min(lst)<EOL>kwargs['<STR_LIT>'] = max(lst)<EOL><DEDENT>elif isinstance(v, basestring):<EOL><INDENT>v = list(map(int, v.split('<STR_LIT:U+002C>')))<EOL>kwargs['<STR_LIT>'] = min(v)<EOL>kwargs['<STR_LIT>'] = max(v)<EOL><DEDENT>else:<EOL><INDENT>kwargs['<STR_LIT>'] = v<EOL>kwargs['<STR_LIT>'] = v<EOL><DEDENT><DEDENT>if k.lower() in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>del kwargs[k]<EOL>if isinstance(v, collections.Iterable):<EOL><INDENT>lst = list(v)<EOL>kwargs['<STR_LIT>'] = min(lst)<EOL>kwargs['<STR_LIT>'] = max(lst)<EOL><DEDENT>elif isinstance(v, basestring):<EOL><INDENT>v = list(map(int, v.split('<STR_LIT:U+002C>')))<EOL>kwargs['<STR_LIT>'] = min(v)<EOL>kwargs['<STR_LIT>'] = max(v)<EOL><DEDENT>else:<EOL><INDENT>kwargs['<STR_LIT>'] = v<EOL>kwargs['<STR_LIT>'] = v<EOL><DEDENT><DEDENT>if k == '<STR_LIT>':<EOL><INDENT>kwargs['<STR_LIT>'] = '<STR_LIT:P>'<EOL><DEDENT>if isinstance(v, basestring):<EOL><INDENT>v = v.split('<STR_LIT:U+002C>')<EOL><DEDENT>if not isinstance(v, collections.Iterable):<EOL><INDENT>v = [v]<EOL><DEDENT><DEDENT>for k in kwargs:<EOL><INDENT>if k in opts:<EOL><INDENT>opts[k] = []<EOL><DEDENT><DEDENT>for k, v in kwargs.items():<EOL><INDENT>if k in opts:<EOL><INDENT>if isinstance(v, basestring):<EOL><INDENT>v = v.split('<STR_LIT:U+002C>')<EOL><DEDENT>elif not isinstance(v, collections.Iterable):<EOL><INDENT>v = [v]<EOL><DEDENT>for val in v:<EOL><INDENT>opts[k].append(val)<EOL><DEDENT><DEDENT><DEDENT>opts['<STR_LIT>'] = [<NUM_LIT:1>]<EOL>qs = '<STR_LIT:&>'.join('<STR_LIT>'.format(name, val)<EOL>for name, vals in sorted(opts.items()) for val in vals)<EOL>return qs<EOL>
Converts kwargs given to GPF to a querystring.

    :returns: the querystring.