<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def strip(value, msg):
 """ Strips all non-essential keys from the value dictionary given the message format protobuf raises ValueError exception if value does not have all required keys :param value: <dict> with arbitrary keys :param msg: <protobuf> with a defined schema :return: NEW <dict> with keys defined by msg, omits any other key """

    dict_to_protobuf.dict_to_protobuf(value, msg)
    try:
        msg.SerializeToString()  #raise error for insufficient input
    except EncodeError as encode_error:
        raise ValueError(str(encode_error))
    output = dict_to_protobuf.protobuf_to_dict(msg)
    return output