def unpack_context(conf, msg):
 context_dict = {}
 for key in list(msg.keys()):
  key = str(key)
  if key.startswith('_context_'):
   value = msg.pop(key)
   context_dict[key[9:]] = value
 context_dict['msg_id'] = msg.pop('_msg_id', None)
 context_dict['reply_q'] = msg.pop('_reply_q', None)
 context_dict['conf'] = conf
 ctx = RpcContext.from_dict(context_dict)
 rpc_common._safe_log(LOG.debug, _('unpacked context: %s'), ctx.to_dict())
 return ctx

def unpack_context ( conf , msg ) : context_dict = { } for key in list ( msg . keys ( ) ) : key = str ( key ) if key . startswith ( '_context_' ) : value = msg . pop ( key ) context_dict [ key [ 9 : ] ] = value context_dict [ 'msg_id' ] = msg . pop ( '_msg_id' , None ) context_dict [ 'reply_q' ] = msg . pop ( '_reply_q' , None ) context_dict [ 'conf' ] = conf ctx = RpcContext . from_dict ( context_dict ) rpc_common . _safe_log ( LOG . debug , _ ( 'unpacked context: %s' ) , ctx . to_dict ( ) ) return ctx
unpack context from msg .