Get information about all messages of interest.
347075
def extract_message_info():
    """"""
    base_path = BASE_PACKAGE.replace('.', '/')
    filename = os.path.join(base_path, 'ProtocolMessage.proto')

    with open(filename, 'r') as file:
        types_found = False

        for line in file:
            stripped = line.lstrip().rstrip()

            # Look for the Type enum
            if stripped == 'enum Type {':
                types_found = True
                continue
            elif types_found and stripped == '}':
                break
            elif not types_found:
                continue

            constant = stripped.split(' ')[0]
            title = constant.title().replace(
                '_', '').replace('Hid', 'HID')  # Hack...
            accessor = title[0].lower() + title[1:]

            if not os.path.exists(os.path.join(base_path, title + '.proto')):
                continue

            yield MessageInfo(
                title + '_pb2', title, accessor, constant)
347636
private Map<String, Message> getMessages(Query qry, Folder folder, String[] uids, String[] messageNumbers, int startRow, int maxRow, boolean all) throws MessagingException {

	Message[] messages = folder.getMessages();
	Map<String, Message> map = qry == null ? new HashMap<String, Message>() : null;
	int k = 0;
	if (uids != null || messageNumbers != null) {
	    startRow = 0;
	    maxRow = -1;
	}
	Message message;
	for (int l = startRow; l < messages.length; l++) {
	    if (maxRow != -1 && k == maxRow) {
		break;
	    }
	    message = messages[l];
	    int messageNumber = message.getMessageNumber();
	    String id = getId(folder, message);

	    if (uids == null ? messageNumbers == null || contains(messageNumbers, messageNumber) : contains(uids, id)) {
		k++;
		if (qry != null) {
		    toQuery(qry, message, id, all);
		}
		else map.put(id, message);
	    }
	}
	return map;
    }
704857
def get_messages(self):
        
        uri = '{}/messages'.format(self.data["uri"])
        return self._helper.do_get(uri)
885822
def all_announcements_view(request):
    '''  '''
    page_name = "Archives - All Announcements"
    userProfile = UserProfile.objects.get(user=request.user)
    announcement_form = None
    manager_positions = Manager.objects.filter(incumbent=userProfile)
    if manager_positions:
        announcement_form = AnnouncementForm(
            request.POST if "post_announcement" in request.POST else None,
            profile=userProfile,
            )
        if announcement_form.is_valid():
            announcement_form.save()
            return HttpResponseRedirect(reverse('managers:all_announcements'))

    # A pseudo-dictionary, actually a list with items of form (announcement,
    # announcement_pin_form)
    announcements_dict = list()
    for a in Announcement.objects.all():
        pin_form = None
        if a.manager.incumbent == userProfile or request.user.is_superuser:
            pin_form = PinForm(
                request.POST if "pin-{0}".format(a.pk) in request.POST else None,
                instance=a,
                )
            if pin_form.is_valid():
                pin_form.save()
                return HttpResponseRedirect(reverse('managers:all_announcements'))
        announcements_dict.append((a, pin_form))
    return render_to_response('announcements.html', {
        'page_name': page_name,
        'manager_positions': manager_positions,
        'announcements_dict': announcements_dict,
        'announcement_form': announcement_form,
        }, context_instance=RequestContext(request))
344523
def data(self):
        ''''''
        # return data after any initial offset, plus content offset to
        # skip header, up to the size of this message
        return self.mmap[self.content_offset + self._offset: self._offset + self.size]
293262
def messaging(self):
        
        if self._messaging is None:
            self._messaging = MessagingList(self)
        return self._messaging
1263251
def mass_inform(self, msg):
        
        assert (msg.mtype == Message.INFORM)
        self._server.mass_send_message_from_thread(msg)
1082851
def process_message_notification(request, messages_path):
    """"""
    if not messages_path:
        return

    global _MESSAGES_CACHE
    global _MESSAGES_MTIME

    # NOTE (lhcheng): Cache the processed messages to avoid parsing
    # the files every time. Check directory modification time if
    # reload is necessary.
    if (_MESSAGES_CACHE is None or
            _MESSAGES_MTIME != os.path.getmtime(messages_path)):
        _MESSAGES_CACHE = _get_processed_messages(messages_path)
        _MESSAGES_MTIME = os.path.getmtime(messages_path)

    for msg in _MESSAGES_CACHE:
        msg.send_message(request)
291058
def show_all_prs(self):
        """"""
        for __, prs in self.collect_prs_info().items():
            for pr_info in prs:
                logger.info(
                    '{url} in state {state} ({merged})'.format(**pr_info)
                )
376930
def get_messages(self):
        
        cs = self.data["comments"]["data"]
        res = [] 
        for c in cs:
            res.append(Message(c,self))
        return res
4826
def show_messages(self):
        """"""
        if isinstance(self.static_message, MessageElement):
            # Handle sent Message instance
            string = html_header()
            if self.static_message is not None:
                string += self.static_message.to_html()

            # Keep track of the last ID we had so we can scroll to it
            self.last_id = 0
            for message in self.dynamic_messages:
                if message.element_id is None:
                    self.last_id += 1
                    message.element_id = str(self.last_id)

                html = message.to_html(in_div_flag=True)
                if html is not None:
                    string += html

            string += html_footer()
        elif (isinstance(self.static_message, str)):
            # Handle sent text directly
            string = self.static_message
        elif self.static_message is not None:
            string = str(self.static_message)
        elif not self.static_message:
            # handle dynamic message
            # Handle sent Message instance
            string = html_header()

            # Keep track of the last ID we had so we can scroll to it
            self.last_id = 0
            for message in self.dynamic_messages:
                if message.element_id is None:
                    self.last_id += 1
                    message.element_id = str(self.last_id)

                html = message.to_html(in_div_flag=True)
                if html is not None:
                    string += html

            string += html_footer()

        # Set HTML
        self.load_html(HTML_STR_MODE, string)
628629
def _process_info_message(self, message):
        """"""
        # Extract the output resolution from the appropriate message, if
        # it's present.
        if message['messageCode'] == 'JOB_RUNNING_RESOLUTION':
            self._resolution = message['contents']['resolutionMs']
        elif message['messageCode'] == 'FETCH_NUM_TIMESERIES':
            self._num_input_timeseries += int(message['numInputTimeSeries'])
572399
def messages(self):
        ''''''

        # The file contains the fixed-size file header followed by
        # fixed-size message structures, followed by minimal message
        # information (subject, from, to).  Start after the file
        # header and then simply return the message structures in
        # sequence until we have returned the number of messages in
        # this folder, ignoring the minimal message information at the
        # end of the file.

        offset = self.header_length # initial offset
        # how much of the data in this file we expect to use, based on
        # the number of messages in this folder and the index message block size
        maxlen = self.header_length + self.total_messages * MacIndexMessage.LENGTH
        while offset < maxlen:
             yield MacIndexMessage(mm=self.mmap, offset=offset)
             offset += MacIndexMessage.LENGTH
1362250
def messages(which = "ALL")
      # read message from all storage in the mobile phone (sim+mem)
      cmd('AT+CPMS="MT"')
      # get message list
      sms = cmd('AT+CMGL="%s"' % which )
      # collect messages
      msgs = sms.scan(/\+CMGL\:\s*?(\d+)\,.*?\,\"(.+?)\"\,.*?\,\"(.+?)\".*?\n(.*)/)
      return nil unless msgs
      msgs.collect!{ |msg| Biju::Sms.new(:id => msg[0], :phone_number => msg[1], :datetime => msg[2], :message => msg[3].chomp) }
    end
202505
def run(self, message):
        """"""
        for value in message:
            self.update(value)
        return [self.low, self.high]
620574
def get_userinfo(self):
        """"""
        wanted_fields = ["name", "mobile", "orgEmail", "position", "avatar"]
        userinfo = {k: self.json_response.get(k, None) for k in wanted_fields}
        return userinfo
141148
def message_details(self, message_id, statistics=False):
        """"""
        response = self._get(
            "/transactional/messages/%s?statistics=%s" % (message_id, statistics))
        return json_to_py(response)