def message_from_event(event, secret):
 msg = event.serialize()
 msg['message_signature'] = compute_signature(msg, secret)
 return msg

def message_from_event ( event , secret ) : msg = event . serialize ( ) msg [ 'message_signature' ] = compute_signature ( msg , secret ) return msg
make an event message ready to be published or stored .