def _toedn(self):
finds  = "<STR_LIT>"<EOL>inputs = "<STR_LIT>"<EOL>wheres = "<STR_LIT>"<EOL>args   = []<EOL>"<STR_LIT>"<EOL>for a,b in self._input:<EOL><INDENT>inputs += "<STR_LIT>".format(a)<EOL>args.append(dump_edn_val(b))<EOL><DEDENT>if inputs:<EOL><INDENT>inputs = "<STR_LIT>".format(inputs)<EOL><DEDENT>"<STR_LIT>"<EOL>for where in self._where:<EOL><INDENT>if isinstance(where, str): <EOL><INDENT>wheres += "<STR_LIT>".format(where)<EOL><DEDENT>elif isinstance(where, (list)):<EOL><INDENT>wheres += "<STR_LIT:U+0020>".join(["<STR_LIT>".format(w) for w in where])<EOL><DEDENT><DEDENT>"<STR_LIT>"<EOL>if self._find == []: <EOL><INDENT>fs = set()<EOL>for p in wheres.replace('<STR_LIT:[>','<STR_LIT:U+0020>').replace('<STR_LIT:]>','<STR_LIT:U+0020>').split('<STR_LIT:U+0020>'):<EOL><INDENT>if p.startswith('<STR_LIT:?>'):<EOL><INDENT>fs.add(p)<EOL><DEDENT><DEDENT>self._find = list(fs)<EOL><DEDENT>finds = "<STR_LIT:U+0020>".join(self._find)<EOL>"<STR_LIT>"<EOL>q = """<STR_LIT>""".format( finds, inputs, wheres)<EOL>return q,args<EOL>
prepare the query for the rest api