<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def FromDictionary(cls, msg_dict):
 """Create from a dictionary with kv pairs. Args: msg_dict (dict):
 A dictionary with information as created by to_dict() Returns: ServiceMessage: the converted message """


        level = msg_dict.get('level')
        msg = msg_dict.get('message')
        now = msg_dict.get('now_time')
        created = msg_dict.get('created_time')
        count = msg_dict.get('count', 1)
        msg_id = msg_dict.get('id', 0)

        new_msg = ServiceMessage(level, msg, msg_id, created, now)
        if count > 1:
            new_msg.count = count

        return new_msg