Return the callbacks associated with a message template.
1300
def get_callbacks_from_message(self, msg):
        """"""
        callbacks = []
        for key in self._find_matching_keys(msg):
            for callback in self[key]:
                callbacks.append(callback)
        return callbacks
402385
def wrap_iter_with_message_events(
    request_or_response_iter,
    span,
    message_event_type
):
    
    for message_id, message in enumerate(request_or_response_iter, start=1):
        add_message_event(
            proto_message=message,
            span=span,
            message_event_type=message_event_type,
            message_id=message_id
        )
        yield message
911150
def get_context_for_help_msgs(self, context_dict):
        
        context_dict = copy(context_dict)
        context_dict['wrapped_func'] = get_callable_name(context_dict['wrapped_func'])
        return context_dict
334792
private void collectTransitiveCallees(TemplateData templateData, Set<TemplateData> visited) {
    if (!visited.add(templateData)) {
      return; // avoids chasing recursive cycles
    }
    for (String callee : templateData.callees) {
      collectTransitiveCallees(getTemplateData(callee), visited);
    }
    for (String delCallee : templateData.delCallees) {
      // for {delcalls} we consider all possible targets
      for (TemplateData potentialCallee : selector.delTemplateNameToValues().get(delCallee)) {
        collectTransitiveCallees(potentialCallee, visited);
      }
    }
  }
1033113
def _get_callargs(self, *args, **kwargs):
        
        callargs = getcallargs(self.func, *args, **kwargs)
        return callargs
522350
def get_message(message, *args, **kwargs):
        """"""
        msg = current_app.extensions['simplelogin'].messages.get(message)
        if msg and (args or kwargs):
            return msg.format(*args, **kwargs)
        return msg
1111553
def _receive_callback(self, raw_message):
        """"""
        message = self.backend.message_to_python(raw_message)
        if self.auto_ack and not message.acknowledged:
            message.ack()
        try:
            decoded = message.decode()
        except Exception, exc:
            if not self.on_decode_error:
                raise
            self.on_decode_error(message, exc)
        else:
            self.receive(decoded, message)
448870
def gotMessage(self, message_id, message):
        
        d = defer.maybeDeferred(self._handle_message, message)
        d.addCallback(self.generate_response)
        d.addCallback(lambda resp: self.reply(message_id, resp))
        return d
615811
def __callback(self, data):
        
        method = self.__cb_message
        if method is not None:
            try:
                method(data)
            except Exception as ex:
                _logger.exception("Error calling method: %s", ex)
704857
def get_messages(self):
        
        uri = '{}/messages'.format(self.data["uri"])
        return self._helper.do_get(uri)
316181
def done(message):
    """"""

    def done(value, _context, **_params):
        return Done(value, message)

    return done
709738
def get_message(self, metadata=False, asctime=True):
        
        msg = self.msg if is_string(self.msg) else str(self.msg)
        if self.args:
            try:
                msg = msg % self.args
            except:
                msg += str(self.args)

        if asctime: msg = "[" + self.asctime + "] " + msg

        # Add metadata
        if metadata:
            msg += "\nCalled by %s at %s:%s\n" % (self.func_name, self.pathname, self.lineno)

        return msg
480795
function _getMappedMethod(message) {
            var method = message && message.method;
            var name = method && method.name;
            var args = method && method.args;
            var eventChannel = this.eventChannel;

            return function() {
                if (eventChannel && eventChannel[name]) {
                    return eventChannel[name].apply(eventChannel, args);
                }
                else {
                    /* istanbul ignore next  */
                    PostMessageUtilities.log("No channel exists", "ERROR", "PostMessageMapper");
                }
            };
        }
1138416
def template(cls, address=None, commandtuple=None,
                 userdata=None, cmd2=-1, flags=None, acknak=None):
        """"""
        msgraw = bytearray([0x02, cls._code])
        msgraw.extend(bytes(cls._receivedSize))
        msg = ExtendedSend.from_raw_message(msgraw)

        if commandtuple:
            cmd1 = commandtuple.get('cmd1')
            cmd2out = commandtuple.get('cmd2')
        else:
            cmd1 = None
            cmd2out = None

        if cmd2 is not -1:
            cmd2out = cmd2

        msg._address = Address(address)
        msg._messageFlags = MessageFlags(flags)
        msg._messageFlags.extended = 1
        msg._cmd1 = cmd1
        msg._cmd2 = cmd2out
        msg._userdata = Userdata.template(userdata)
        msg._acknak = acknak
        return msg
558865
def process_message(message_text):
    
    message_text = normalize_message(message_text)
    for (regex, data_lambda) in TEMPLATES:
        match = regex.search(message_text)
        if match:
            result = Request(**data_lambda(match))
            return result
1129235
public function getMessages(): array
    {
        $templates = [
            new Message($this->message->getBody(), $this->message->getContentType()),
        ];

        // TODO: Loop through parts

        return $templates;
    }
286889
function(callback) {
      if (Object.keys(templateDependencies).indexOf(args['<template>']) === -1) {
        return callback(new Error(format('Unknown template "%s". Run '
          + '`mj help create` for list of valid templates.', args['<template>'])));
      }
      return callback(null);
    }