def pack_context(msg, context):
 context_d = dict([(('_context_%s' % key), value) for (key, value) in context.to_dict().iteritems()])
 msg.update(context_d)

def pack_context ( msg , context ) : context_d = dict ( [ ( ( '_context_%s' % key ) , value ) for ( key , value ) in context . to_dict ( ) . iteritems ( ) ] ) msg . update ( context_d )
pack context into msg .