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
def successfuly_encodes ( msg , raise_err = False ) : result = True try : msg . SerializeToString ( ) except EncodeError as encode_error : if raise_err : raise encode_error result = False return result
boolean response if a message contains correct information to serialize

    :param msg: <proto object>
    :param raise_err: <bool>
    :return: <bool>