Get all of the active messages ordered by the active_datetime.
185336
def get_all_active(self):
        
        now = timezone.now()
        return self.select_related().filter(active_datetime__lte=now,
                                              inactive_datetime__gte=now).order_by('active_datetime')
447969
def time_since(self, mtype):
        ''''''
        if not mtype in self.messages:
            return time.time() - self.start_time
        return time.time() - self.messages[mtype]._timestamp
1307847
def get_active_sessions(self):
        
        for last_timestamp, i, events in self.recently_active:
            yield Session(events[-1].user, unpack_events(events))
685172
def active_days(records):
    
    days = set(r.datetime.date() for r in records)
    return len(days)
407583
@Override
    public List getActiveOutboundMEtoMEConversations() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "getActiveOutboundMEtoMEConversations");

        List convs = null;
        if (connectionTracker != null) {
            convs = connectionTracker.getAllOutboundConversations();
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "getActiveOutboundMEtoMEConversations", convs);
        return convs;
    }
880386
def date_sorted_sources(*sources):
    
    sorted_stream = heapq.merge(*(_decorate_source(s) for s in sources))

    # Strip out key decoration
    for _, message in sorted_stream:
        yield message
331785
def active(self, date="", page=1, page_size=1000, order_field="email", order_direction="asc", include_tracking_preference=False):
        """"""
        params = {
            "date": date,
            "page": page,
            "pagesize": page_size,
            "orderfield": order_field,
            "orderdirection": order_direction,
            "includetrackingpreference": include_tracking_preference,
        }
        response = self._get(self.uri_for("active"), params=params)
        return json_to_py(response)
162728
def all_entities(self, is_active=True):
        
        return self.get_all_entities(return_models=True, is_active=is_active)
376930
def get_messages(self):
        
        cs = self.data["comments"]["data"]
        res = [] 
        for c in cs:
            res.append(Message(c,self))
        return res
202505
def run(self, message):
        """"""
        for value in message:
            self.update(value)
        return [self.low, self.high]
628837
def refresh(self, thread=None):
        """"""
        if not thread:
            thread = self._dbman._get_notmuch_thread(self._id)

        self._total_messages = thread.get_total_messages()
        self._notmuch_authors_string = thread.get_authors()

        subject_type = settings.get('thread_subject')
        if subject_type == 'notmuch':
            subject = thread.get_subject()
        elif subject_type == 'oldest':
            try:
                first_msg = list(thread.get_toplevel_messages())[0]
                subject = first_msg.get_header('subject')
            except IndexError:
                subject = ''
        self._subject = subject

        self._authors = None
        ts = thread.get_oldest_date()

        try:
            self._oldest_date = datetime.fromtimestamp(ts)
        except ValueError:  # year is out of range
            self._oldest_date = None
        try:
            timestamp = thread.get_newest_date()
            self._newest_date = datetime.fromtimestamp(timestamp)
        except ValueError:  # year is out of range
            self._newest_date = None

        self._tags = {t for t in thread.get_tags()}
        self._messages = {}  # this maps messages to its children
        self._toplevel_messages = []
266783
def active_inactive(self):
        """"""
        active_indices = []
        inactive_indices = []
        for index, active in enumerate(self.active):
            if active:
                active_indices.append(index)
            else:
                inactive_indices.append(index)
        return active_indices, inactive_indices
440272
def messages(self):
        
        if self._messages is None:
            self._messages = MessageList(self._version, session_sid=self._solution['sid'], )
        return self._messages
615044
public function messages()
	{
		$messages = $this->_messages;

		// sort messages by their timestamp
		usort($messages, function($a, $b)
		{
			if ($a['time'] === $b['time'])
			{
				return 0;
			}
			return $a['time'] < $b['time'] ? -1 : 1;
		});

		return $messages;
	}
79802
def _get_dispatches_for_update(filter_kwargs):
    """"""

    dispatches = Dispatch.objects.prefetch_related('message').filter(
        **filter_kwargs

    ).select_for_update(
        **GET_DISPATCHES_ARGS[1]

    ).order_by('-message__time_created')

    try:
        dispatches = list(dispatches)

    except NotSupportedError:
        return None

    except DatabaseError:  # Probably locked. That's fine.
        return []

    return dispatches
985371
def get_applicable_values(self):
        """"""
        return [v for v in self._values if v.is_active and not v.is_all_results]
1017933
protected function retrieveActiveSortFromSession()
    {
        $sessionSort = $this->getListMemory()->getSortData();

        if ( ! is_array($sessionSort)) return;

        $this->activeSort = array_get($sessionSort, 'column');

        $direction = array_get($sessionSort, 'direction');

        if (null === $direction) {
            $this->activeSortDescending = null;
        } else {
            $this->activeSortDescending = $direction === 'desc';
        }
    }