def handleJsonMessage(self, incomingJsonMessage):
        if not isinstance(incomingJsonMessage, dict):
            raise MalformedMessageException(
                "Incoming message was not a dictionary: %s" % incomingJsonMessage)

        if not 'messageId' in incomingJsonMessage:
            raise MalformedMessageException(
                "Invalid incoming message id: %s" % incomingJsonMessage)

        if incomingJsonMessage['messageId'] != self.expectedMessageId:
            raise MalformedMessageException(
                "Invalid incoming message id: expected %s, but got %s. %s" %
                (self.expectedMessageId, incomingJsonMessage['messageId'], incomingJsonMessage)
                )

        try:
            self.expectedMessageId += 1

            if incomingJsonMessage['messageType'] not in self.messageTypeHandlers:
                raise MalformedMessageException("Invalid incoming messageType")

            if not incomingJsonMessage in 'objectDefinition':
                raise MalformedMessageException("No object definition given")

            if incomingJsonMessage["messageType"] != "ServerFlushObjectIdsBelow":
                obj = self.extractObjectDefinition(incomingJsonMessage['objectDefinition'])
            else:
                obj = None

            return self.messageTypeHandlers[incomingJsonMessage["messageType"]](incomingJsonMessage, obj)
        except MalformedMessageException:
            raise
        except Exception as e:
            return [unexpectedExceptionJson(incomingJsonMessage, Exceptions.wrapException(e).message)]
dataset/ETHPy150Open ufora/ufora/ufora/BackendGateway/SubscribableWebObjects/MessageProcessor.py/MessageProcessor.handleJsonMessage/swapped operands of `in`