def suggest(self):
        pattern = QtCore.QRegExp('\w+$')
        cursor = self._editor.textCursor()
        block = cursor.block()
        text = block.text()
        if not self._room or not self._room.users or not text or cursor.hasSelection():
            return False

        blockText = QtCore.QString(text[:cursor.position() - block.position()])
        matchPosition = blockText.indexOf(pattern)
        if 0 < matchPosition:
            return False

        word = blockText[matchPosition:]
        if word.trimmed().isEmpty():
            return False

        matchingUserNames = []
        for user in self._room.users:
            if QtCore.QString(user["name"]).startsWith(word, QtCore.Qt.CaseInsensitive):
                matchingUserNames.append(user["name"])

        if len(matchingUserNames) == 1:
            self._replace(cursor, word, matchingUserNames[0] + (": " if matchPosition == 0 else " "))
        else:
            menu = QtGui.QMenu('Suggestions', self._editor)
            for userName in matchingUserNames:
                action = QtGui.QAction(userName, menu)
                action.setData((cursor, word, userName, matchPosition))
                self.connect(action, QtCore.SIGNAL("triggered()"), self._userSelected)
                menu.addAction(action)
            menu.popup(self._editor.mapToGlobal(self._editor.cursorRect().center()))
dataset/ETHPy150Open mariano/snakefire/snakefire/qtx.py/Suggester.suggest/swapped operands of `<`