Return message parts in current context
179300
public function mime_parts()
    {
        if ($this->context === null) {
            return $this->mime_parts;
        }

        $parts = array();

        foreach ($this->mime_parts as $part_id => $part) {
            if ($this->check_context($part)) {
                $parts[$part_id] = $part;
            }
        }

        return $parts;
    }
958816
def get_context_data(self, **kwargs):
        

        context = {'obj': self.object }
        if 'queryset' in kwargs:
            context['conf_msg'] = self.get_confirmation_message(kwargs['queryset'])
        context.update(kwargs)
        return context
1313953
async def service_messages(self, msg, _context):
        """"""

        msgs = self.service_manager.service_messages(msg.get('name'))
        return [x.to_dict() for x in msgs]
1074828
def message(self):
        
        template_name = self.template_name() if \
            callable(self.template_name) \
            else self.template_name
        return loader.render_to_string(
            template_name, self.get_context(), request=self.request
        )
1211862
def _StructMessageToJsonObject(self, message):
    """"""
    fields = message.fields
    ret = {}
    for key in fields:
      ret[key] = self._ValueMessageToJsonObject(fields[key])
    return ret
43553
function getMessages(result) {
  let messages = [];
  if (result.messages) {
    messages = messages.concat(result.messages);
  }
  if (result.schemaValidationMessages) {
    messages = messages.concat(
      result.schemaValidationMessages.map((m) => `${m.level}: ${m.message}`)
    );
  }
  return messages;
}
124053
def from_raw_message(cls, rawmessage):
        """"""
        return AllLinkComplete(rawmessage[2],
                               rawmessage[3],
                               rawmessage[4:7],
                               rawmessage[7],
                               rawmessage[8],
                               rawmessage[9])
81643
def context_chain(self) -> List['Context']:
        """"""
        contexts = []
        ctx = self  # type: Optional[Context]
        while ctx is not None:
            contexts.append(ctx)
            ctx = ctx.parent

        return contexts
1072848
function parseSafeMessage(message, status) {
  if (typeof message === 'object') {
    return {status: message.errorCode, message: message.description};
  } else {
    return {status: status, message: message};
  }
}
576169
def match(self, url):
        
        return list({
            message for message in self.active() if
            message.is_global or message.match(url)
        })
784343
def from_raw_message(cls, rawmessage):
        """"""
        userdata_dict = Userdata(rawmessage[8:22])
        return ExtendedSend(rawmessage[2:5],
                            {'cmd1': rawmessage[6],
                             'cmd2': rawmessage[7]},
                            userdata_dict,
                            flags=rawmessage[5],
                            acknak=rawmessage[22:23])
114001
def get(self):
        """"""

        # First retrieve all header bytes in order to extract
        # length of the message remainder.
        header = ''
        while len(header) < self.HEADER_LENGTH:
            chunk = self._sock.recv(self.HEADER_LENGTH - len(header))
            chunk = chunk.decode() if self._encode else chunk
            if chunk == '':
                return None
            header += chunk
        length = int(header)

        # Then retrieve the remainder of the message.
        message = ''
        while len(message) < length:
            chunk = self._sock.recv(length - len(message))
            chunk = chunk.decode() if self._encode else chunk
            if chunk == '':
                return None
            message += chunk
        return message
1120303
def get_context_data(self, **kwargs):
        """"""
        context = super().get_context_data(**kwargs)
        context.update({
            'title': self.title,
            'submit_value': self.submit_value,
            'cancel_url': self.cancel_url
        })
        return context
151115
def pub_msg(self, msg):
        """"""
        topic = msg.get('topic')
        self.pub_socket.send_multipart(
            [pickle.dumps(topic), pickle.dumps(msg)])

        for h in self._handle_funcs.get(topic, []):
            h(msg)
476582
def extract_from_plain(msg_body):
    """"""
    stripped_text = msg_body

    delimiter = get_delimiter(msg_body)
    msg_body = preprocess(msg_body, delimiter)
    # don't process too long messages
    lines = msg_body.splitlines()[:MAX_LINES_COUNT]
    markers = mark_message_lines(lines)
    lines = process_marked_lines(lines, markers)

    # concatenate lines, change links back, strip and return
    msg_body = delimiter.join(lines)
    msg_body = postprocess(msg_body)
    return msg_body
441325
def to_message(self):
        """"""
        my_message = m.Message()
        if self.static_message is not None:
            my_message.add(self.static_message)
        for myDynamic in self.dynamic_messages:
            my_message.add(myDynamic)
        return my_message
519241
def _get_ldap_msg(e):
        """"""
        msg = e
        if hasattr(e, 'message'):
            msg = e.message
            if 'desc' in e.message:
                msg = e.message['desc']
            elif hasattr(e, 'args'):
                msg = e.args[0]['desc']
        return msg