<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def successfuly_encodes(msg, raise_err=False):
 """ boolean response if a message contains correct information to serialize :param msg: <proto object> :param raise_err: <bool> :return: <bool> """

    result = True
    try:
        msg.SerializeToString()
    except EncodeError as encode_error:
        if raise_err:
            raise encode_error
        result = False
    return result