Gets count of unread messages from client
350410
def get_client_unread_messages_count(self, client_name=None):
        
        client = self._clients.get_with_name(client_name)[0]
        return client.get_messages_count_in_buffer()
612843
function unreadMessageCount( $collaborationItem )
    {
        $lastRead = 0;
        $status = $collaborationItem->attribute( 'user_status' );
        if ( $status )
            $lastRead = $status->attribute( 'last_read' );
        return eZCollaborationItemMessageLink::fetchItemCount( array( 'item_id' => $collaborationItem->attribute( 'id' ),
                                                                      'conditions' => array( 'modified' => array( '>', $lastRead ) ) ) );
    }
664293
public function getUnreadMessages($read = true) {
        $emails = [];
        $result = imap_search($this->imap, 'UNSEEN');
        if(!$result){
            throw new ImapClientException('No read messages were found.');
        };
        $ids = ''; $countId = count($result);
        foreach($result as $key=>$id) {
            $emails[]= $this->getMessage($id);
            if(($countId-1) == $key){
                $ids .= $id;
            }else{
                $ids .= $id.',';
            };
        }
        /* Set flag UNSEEN */
        if(!$read){
            $this->setUnseenMessage($ids);
        }else{
            $this->setSeenMessage($ids);
        };
        return $emails;
    }
921557
def count_never_executed(self):
        """"""
        lineno = self.firstlineno
        counter = 0
        for line in self.source:
            if self.sourcelines.get(lineno) == 0:
                if not self.blank_rx.match(line):
                    counter += 1
            lineno += 1
        return counter
752603
def _read_msg(session):
    
    if len(session.data) == session.message_length:
        # Data Already completely read.  Return
        return True

    try:
        data = session.socket.recv(session.message_length - len(session.data))
        if len(data) == 0:
            raise PushException("No Data on Socket!")
        session.data += data
    except ssl.SSLError:
        # This can happen when select gets triggered
        # for an SSL socket and data has not yet been
        # read.  Wait for it to get triggered again.
        return False

    # Whether or not all data was read.
    return len(session.data) == session.message_length
237135
def get_count(self, prefix=''):
        """"""
        return sum([self.counters[key]
                    for key in self.messages if key.startswith(prefix)])
430262
public int getNumberOfActiveMessages()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(tc, "getNumberOfActiveMessages");
    int activeMessages = 
      (int)_sourceStream.countAllMessagesOnStream();
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.exit(tc, "getNumberOfActiveMessages", new Integer(activeMessages));      
    return activeMessages;
  }
580279
def unread_all(self, user=None):
        
        qs = self.read()
        if user:
            qs = qs.filter(recipient=user)
        qs.update(read=False)
683596
def read(self):
        ''''''
        responses = self._read()
        # Determine the number of messages in here and decrement our ready
        # count appropriately
        self.ready -= sum(
            map(int, (r.frame_type == Message.FRAME_TYPE for r in responses)))
        return responses
154635
def get_unread(self, request, notifications, mark_as_read):
        
        notifications = notifications.filter(is_read=False)
        serializer = UnreadNotificationSerializer(list(notifications),  # evaluate queryset
                                                  many=True,
                                                  context=self.get_serializer_context())
        # retrieve unread notifications as read (default behaviour)
        if mark_as_read:
            notifications.update(is_read=True)
        return Response(serializer.data)
792310
def MultiReadClientFullInfo(self, client_ids, min_last_ping=None):
    """"""
    res = {}
    for client_id in client_ids:
      try:
        md = self.ReadClientMetadata(client_id)
      except db.UnknownClientError:
        continue

      if md and min_last_ping and md.ping < min_last_ping:
        continue
      last_snapshot = self.ReadClientSnapshot(client_id)
      full_info = rdf_objects.ClientFullInfo(
          metadata=md,
          labels=self.ReadClientLabels(client_id),
          last_startup_info=self.ReadClientStartupInfo(client_id))
      if last_snapshot is None:
        full_info.last_snapshot = rdf_objects.ClientSnapshot(
            client_id=client_id)
      else:
        full_info.last_snapshot = last_snapshot
      res[client_id] = full_info
    return res
197045
def get_unread_topics(context, topics, user):
    
    request = context.get('request', None)
    return TrackingHandler(request=request).get_unread_topics(topics, user)
217741
def messages_count(user)
      Message.search do
        with(:receiver_id).equal_to user.id
        with(:is_read).equal_to false
      end.hits.total_entries
    end
339331
def get_count(self, request, notifications, mark_as_read=False):
        
        return Response({'count': notifications.filter(is_read=False).count()})
1362384
def get_alerts_unarchived(self):
        """"""

        js = json.dumps({'_sort': '-time', 'archived': False})
        params = urllib.urlencode({'json': js})
        return self._read(self.api_url + 'list/alarm', params)
125211
@SuppressWarnings({"unused", "WeakerAccess"})
    public int getInboxMessageUnreadCount(){
        synchronized (inboxControllerLock) {
            if (this.ctInboxController != null) {
                return ctInboxController.unreadCount();
            } else {
                getConfigLogger().debug(getAccountId(), "Notification Inbox not initialized");
                return -1;
            }
        }
    }
661665
def ReadClientStats(self, client_id,
                      min_timestamp,
                      max_timestamp
                     ):
    """"""
    results = []
    for timestamp, stats in iteritems(self.client_stats[client_id]):
      if min_timestamp <= timestamp <= max_timestamp:
        results.append(stats)
    return results