def guess_message_type(message):
    """
    Guess the message type based on the class of message

    :param message: Message to guess the type for
    :type message: APPMessage
    :return: The corresponding message  type (MsgType) or None if not found
    :rtype: None | int
    """
    if isinstance(message, APPConfigMessage):
        return MsgType.CONFIG
    elif isinstance(message, APPJoinMessage):
        return MsgType.JOIN
    elif isinstance(message, APPDataMessage):
        # All inheriting from this first !!
        return MsgType.DATA
    elif isinstance(message, APPUpdateMessage):
        return MsgType.UPDATE
    elif isinstance(message, APPUnjoinMessage):
        return MsgType.UNJOIN
    # APPMessage -> ACK?
    return None
def guess_message_type ( message ) : if isinstance ( message , APPConfigMessage ) : return MsgType . CONFIG elif isinstance ( message , APPJoinMessage ) : return MsgType . JOIN elif isinstance ( message , APPDataMessage ) : return MsgType . DATA elif isinstance ( message , APPUpdateMessage ) : return MsgType . UPDATE elif isinstance ( message , APPUnjoinMessage ) : return MsgType . UNJOIN return None
Guess the message type based on the class of message

    :param message: Message to guess the type for
    :type message: APPMessage
    :return: The corresponding message  type (MsgType) or None if not found
    :rtype: None | int