def query(self, word):
        if word in self.word_list:  # search word_list first to save query time
            return self.word_list[word]

        error_encountered = 0
        good_backends=[]
        faulty_backends=[]
        for query_backend_curr in self.query_backend_priority:  # query each of the backend list till found
            specified_language = get_variable("tq_language")
            if specified_language!="All":
                if specified_language==-1:
                    if self.query_backends[query_backend_curr].language!='en':
                        continue
                elif specified_language not in self.query_backends[query_backend_curr].language:
                    continue
            [state, synonym_list]=self.query_backends[query_backend_curr].query(word)
            if state == -1:
                error_encountered = 1
                faulty_backends.append(self.query_backends[query_backend_curr].identifier)
                continue
            if state == 0:
                good_backends.append(self.query_backends[query_backend_curr].identifier)
                break
        for faulty in faulty_backends:
            self.query_backend_priority.remove(faulty)
        self.query_backend_priority+=faulty_backends
        if int(vim.eval("g:tq_raise_backend_priority_if_synonym_found")) == 1:
            for good in good_backends:
                self.query_backend_priority.remove(good)
            self.query_backend_priority=good_backends+self.query_backend_priority
        if error_encountered == 1:
            vim.command('echohl WarningMSG | echon "WARNING: " | echohl None | echon "one or more query backends report error. Please check on thesaurus source(s).\n"')
        if 'state' not in locals():
            vim.command('echohl WarningMSG | echon "WARNING: " | echohl None | echon "No thesaurus source is used. Please check on your configuration on g:thesaurus_query#enabled_backends and g:tq_language or b:tq_language.\n"')
            return []
        if state == 0:  # save to word_list buffer only when synonym is found
            self.word_list[word]=synonym_list
            self.word_list_keys.append(word)
            if len(self.word_list_keys) > self.wordlist_size_max:
                del self.word_list[self.word_list_keys.pop(0)]
        return synonym_list
dataset/ETHPy150Open Ron89/thesaurus_query.vim/autoload/thesaurus_query/thesaurus_query.py/Thesaurus_Query_Handler.query/swapped operands of `not in`