Produce a Protobuf module from a string description.

    Return the module if successfully compiled, otherwise raise a BadProtobuf
    exception.

def from_string(proto_str):
    '''
    Produce a Protobuf module from a string description.

    Return the module if successfully compiled, otherwise raise a BadProtobuf
    exception.
    '''
    _, proto_file = tempfile.mkstemp(suffix='.proto')

    with open(proto_file, 'w+') as proto_f:
        proto_f.write(proto_str)

    return from_file(proto_file)