def _singleSearchStep(self, query, id, msg, lastSequenceId, lastMessageId):
        """
        Pop one search term from the beginning of C{query} (possibly more than
        one element) and return whether it matches the given message.

        @param query: A list representing the parsed form of the search query.

        @param id: The sequence number of the message being checked.

        @param msg: The message being checked.

        @param lastSequenceId: The highest sequence number of any message in
            the mailbox being searched.

        @param lastMessageId: The highest UID of any message in the mailbox
            being searched.

        @return: Boolean indicating whether the query term matched the message.
        """

        q = query.pop(0)
        if isinstance(q, list):
            if not self._searchFilter(q, id, msg,
                                      lastSequenceId, lastMessageId):
                return False
        else:
            c = q.upper()
            if not c[:1].isalpha():
                # A search term may be a word like ALL, ANSWERED, BCC, etc (see
                # below) or it may be a message sequence set.  Here we
                # recognize a message sequence set "N:M".
                messageSet = parseIdList(c, lastSequenceId)
                return id in messageSet
            else:
                f = getattr(self, 'search_' + c, None)
                if f is None:
                    raise IllegalQueryError("Invalid search command %s" % c)

                if self._requiresLastMessageInfo in c:
                    result = f(query, id, msg, (lastSequenceId,
                                                lastMessageId))
                else:
                    result = f(query, id, msg)

                if not result:
                    return False
        return True
dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/mail/imap4.py/IMAP4Server._singleSearchStep/swapped operands of `in`