return count of unread notification
339331
def get_count(self, request, notifications, mark_as_read=False):
        
        return Response({'count': notifications.filter(is_read=False).count()})
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
627482
public function getUnreadMessagesCount($uid)
	{
		if (!$uid)
		{
			return 0;
		}

		$r = $this->getTableName();
		$m = Message::blank()->getTableName();
		$s = Seen::blank()->getTableName();

		$entries = Message::blank()
			->join($r, $m . '.id', $r . '.mid', 'inner')
			->whereEquals($r . '.uid', $uid)
			->where($r . '.state', '!=', 2)
			->whereRaw($m . ".id NOT IN (SELECT s.mid FROM `" . $s . "` AS s WHERE s.uid=" . $uid . ")");

		return $entries->total();
	}
485193
def get_notifications(self, **params):
        """"""
        response = self._get('v2', 'notifications', params=params)
        return self._make_api_object(response, Notification)
264968
def get_listener_count(self):
        """"""

        if hasattr(self, "listener_count"):
            return self.listener_count
        else:
            self.listener_count = _number(
                _extract(self._request(self.ws_prefix + ".getInfo", True), "listeners")
            )
            return self.listener_count
655922
def get_current_notification(self):
        
        log.debug("getting visible notification...")
        cmd, url = DEVICE_URLS["get_current_notification"]
        return self._exec(cmd, url)
237135
def get_count(self, prefix=''):
        """"""
        return sum([self.counters[key]
                    for key in self.messages if key.startswith(prefix)])
912117
function (notification) {
      if (!notification.id) {
        return false;
      }

      return _.some(notifications, function(next) {
        return !next.hidden && notification.id === next.id;
      });
    }
369442
def total_msg_sent(self):
        
        return (self.get_count(PeerCounterNames.SENT_REFRESH) +
                self.get_count(PeerCounterNames.SENT_UPDATES))
1079833
def get_upcoming_events(self):
        
        mask = "mask[id, subject, startDate, endDate, statusCode, acknowledgedFlag, impactedResourceCount, updateCount]"
        _filter = {
            'endDate': {
                'operation': '> sysdate'
            },
            'startDate': {
                'operation': 'orderBy',
                'options': [{
                    'name': 'sort',
                    'value': ['ASC']
                }]
            }
        }
        return self.client.call('Notification_Occurrence_Event', 'getAllObjects', filter=_filter, mask=mask, iter=True)
95955
def get(self, name):
        
        if not self.loaded:
            raise RegistryNotLoaded(self)
        if not self._registry.get(name):
            raise NotificationNotRegistered(
                f"Notification not registered. Got '{name}'."
            )
        return self._registry.get(name)
827296
private int getUnSeenMessageCount() 
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc,"getUnseenMessageCount");
      
      int remain = 0;
      for (int x = nextIndex; x < messages.length; x++)
      {
         if (messages[x] != null) remain++;
      }
      
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc,"getUnseenMessageCount", ""+remain);
      return remain;
   }
992569
protected function getUnreadNotifications()
    {
        static $cached = null;

        if (is_null($cached)) {
            $cached = $this->notifications()
                ->whereIn('type', $this->getAlertableNotificationTypes())
                ->whereNull('read_at')
                ->where('is_deleted', false)
                ->whereSubjectVisibleTo($this)
                ->get();
        }

        return $cached;
    }
70610
def _empty_notification(self):
        
        sess = cherrypy.session
        username = sess.get(SESSION_KEY, None)
        if username in self.notifications:
            ret = self.notifications[username]
        else:
            ret = []
        self.notifications[username] = []
        return ret
295502
def _notifications(self):
        
        if not self.username or not self.auth_token:
            if not self.notification_warning:
                self.py3.notify_user(
                    "Github module needs username and "
                    "auth_token to check notifications."
                )
                self.notification_warning = True
            return "?"
        if self.notifications == "all" or not self.repo:
            url = self.url_api + "/notifications"
        else:
            url = self.url_api + "/repos/" + self.repo + "/notifications"
        url += "?per_page=100"
        try:
            info = self.py3.request(url, auth=(self.username, self.auth_token))
        except (self.py3.RequestException):
            return
        if info.status_code == 200:
            links = info.headers.get("Link")

            if not links:
                return len(info.json())

            last_page = 1
            for link in links.split(","):
                if 'rel="last"' in link:
                    last_url = link[link.find("<") + 1 : link.find(">")]
                    parsed = urlparse.urlparse(last_url)
                    last_page = int(urlparse.parse_qs(parsed.query)["page"][0])

            if last_page == 1:
                return len(info.json())
            try:
                last_page_info = self.py3.request(
                    last_url, auth=(self.username, self.auth_token)
                )
            except self.py3.RequestException:
                return

            return len(info.json()) * (last_page - 1) + len(last_page_info.json())

        if info.status_code == 404:
            if not self.repo_warning:
                self.py3.notify_user("Github repo cannot be found.")
                self.repo_warning = True
1117741
def notifications_mark_read(input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/notifications/markRead', input_params, always_retry=always_retry, **kwargs)
1060615
def live_unread_notification_list(request):
    '''  '''
    try:
        user_is_authenticated = request.user.is_authenticated()
    except TypeError:  # Django >= 1.11
        user_is_authenticated = request.user.is_authenticated

    if not user_is_authenticated:
        data = {
            'unread_count': 0,
            'unread_list': []
        }
        return JsonResponse(data)

    default_num_to_fetch = get_config()['NUM_TO_FETCH']
    try:
        # If they don't specify, make it 5.
        num_to_fetch = request.GET.get('max', default_num_to_fetch)
        num_to_fetch = int(num_to_fetch)
        if not (1 <= num_to_fetch <= 100):
            num_to_fetch = default_num_to_fetch
    except ValueError:  # If casting to an int fails.
        num_to_fetch = default_num_to_fetch

    unread_list = []

    for notification in request.user.notifications.unread()[0:num_to_fetch]:
        struct = model_to_dict(notification)
        struct['slug'] = id2slug(notification.id)
        if notification.actor:
            struct['actor'] = str(notification.actor)
        if notification.target:
            struct['target'] = str(notification.target)
        if notification.action_object:
            struct['action_object'] = str(notification.action_object)
        if notification.data:
            struct['data'] = notification.data
        unread_list.append(struct)
        if request.GET.get('mark_as_read'):
            notification.mark_as_read()
    data = {
        'unread_count': request.user.notifications.unread().count(),
        'unread_list': unread_list
    }
    return JsonResponse(data)