Check the database for missing notifications.
8291
def check_db_for_missing_notifications():
    """"""
    config = dallinger.config.get_config()
    participants = Participant.query.filter_by(status="working").all()
    reference_time = datetime.now()

    run_check(participants, config, reference_time)
1155007
def check_issues(issues, after=None):
    """"""
    issues = closed_issues(issues, after) if after else all_issues(issues)
    issues = sorted(issues, key=ISSUES_SORT_KEY)

    have_warnings = False

    for section, issue_group in groupby(issues, key=ISSUES_BY_SECTION):
        for issue in issue_group:
            have_warnings |= check_issue(issue, after)

    return have_warnings
614416
def notify_update(self):
    """"""
    with self._lock:
      for event in self._update_events:
        event.set()
      self._update_events.clear()
311584
def ReadUserNotifications(self,
                            username,
                            state=None,
                            timerange=None,
                            cursor=None):
    """"""

    query = ("SELECT UNIX_TIMESTAMP(timestamp), "
             "       notification_state, notification "
             "FROM user_notification "
             "WHERE username_hash = %s ")
    args = [mysql_utils.Hash(username)]

    if state is not None:
      query += "AND notification_state = %s "
      args.append(int(state))

    if timerange is not None:
      time_from, time_to = timerange  # pylint: disable=unpacking-non-sequence

      if time_from is not None:
        query += "AND timestamp >= FROM_UNIXTIME(%s) "
        args.append(mysql_utils.RDFDatetimeToTimestamp(time_from))

      if time_to is not None:
        query += "AND timestamp <= FROM_UNIXTIME(%s) "
        args.append(mysql_utils.RDFDatetimeToTimestamp(time_to))

    query += "ORDER BY timestamp DESC "

    ret = []
    cursor.execute(query, args)

    for timestamp, state, notification_ser in cursor.fetchall():
      n = rdf_objects.UserNotification.FromSerializedString(notification_ser)
      n.timestamp = mysql_utils.TimestampToRDFDatetime(timestamp)
      n.state = state
      ret.append(n)

    return ret
229115
private function checkBeforeUpdate()
    {
        if (0 <= version_compare(BBApplication::VERSION, '1.1')) {
            $schemaManager = $this->em->getConnection()->getSchemaManager();
            $pageName = $this->em->getClassMetadata('BackBee\NestedNode\Page')->getTableName();
            $sectionName = $this->em->getClassMetadata('BackBee\NestedNode\Section')->getTableName();

            if (false === $schemaManager->tablesExist($sectionName) && true === $schemaManager->tablesExist($pageName)) {
                throw new BBException(sprintf('Table `%s` does not exist. Perhaps you should launch bbapp:upgradeToPageSection command before.', $sectionName));
            }
        }
    }
1179780
protected function checkForUpdates()
    {
        $managedEntities = $this->entityRegistry->getEntities();

        foreach ($managedEntities as $entity) {
            $objectHashId = $this->entityRegistry->getObjectHashId($entity);

            if ($this->entityRegistry->isRegistered($entity)
                && !isset($this->scheduledForInsertion[$objectHashId])
                && !isset($this->scheduledForUpdate[$objectHashId])
                && !isset($this->scheduledForDeletion[$objectHashId])
                && $this->changeTracker->hasChanged($entity)
            ) {
                $this->scheduleForUpdate($entity);
            }
        }
    }
915305
def GetNotifications(self, queue):
    """"""
    queue_shard = self.GetNotificationShard(queue)
    return self._GetUnsortedNotifications(queue_shard).values()
1039620
def retrieve_old_notifications(self):
        

        date = ago(days=DELETE_OLD)

        return Notification.objects.filter(added__lte=date)
743612
private void checkDependencies() {
    if (basedOnResult != null) {
      if (!input.isComplete() || !algs.isComplete() || basedOnResult.get() != algs.getAlgorithmStep().getResult()) {
        // We've become invalidated, notify.
        basedOnResult = null;
        firePanelUpdated();
      }
    }
  }
1186245
function listNotifications(params, cb) {

  params.resourcePath = config.addURIParams(constants.NOTIFICATIONS_BASE_PATH, params);
  params.method = 'GET';
  params.data = params.data || {};
  mbaasRequest.admin(params, cb);
}
1031751
def absence_info(self):
        """"""
        # FIXME: remove recursive dep
        from ..eighth.models import EighthSignup

        return EighthSignup.objects.filter(user=self, was_absent=True, scheduled_activity__attendance_taken=True)
424439
def issues_notifications(user):
    ''''''
    notifications = []

    # Only fetch required fields for notification serialization
    # Greatly improve performances and memory usage
    qs = issues_for(user).only('id', 'title', 'created', 'subject')

    # Do not dereference subject (so it's a DBRef)
    # Also improve performances and memory usage
    for issue in qs.no_dereference():
        notifications.append((issue.created, {
            'id': issue.id,
            'title': issue.title,
            'subject': {
                'id': issue.subject['_ref'].id,
                'type': issue.subject['_cls'].lower(),
            }
        }))

    return notifications
676493
def _get_notifications_status(self, notifications):
        
        if notifications:
            size = len(notifications["activeNotifications"])
        else:
            size = 0
        status = self.status_notif if size > 0 else self.status_no_notif

        return (size, status)
661191
def _check_for_pending(self, *args, **kwargs):
        
        if self._notification_pending and not self._processing:
            self._processing = True
            args, kwargs = self._data
            self._notify(*args, **kwargs)
            self._notification_pending = False
            self._processing = False
833526
def audit_ghosts(self):
        """"""
        print_header = True
        for app_name in self._get_ghosts():
            if print_header:
                print_header = False
                print (
                    "Found the following in the state database but not "
                    "available as a configured job:"
                )
            print "\t%s" % (app_name,)
151741
def validate(self):
		''''''
		for header in self._requiredHeaders:
			if not self.headers.get(header, False):
				raise errors.ParseError('Missing Registration Header: ' + header)
		for notice in self.notifications:
			for header in self._requiredNotificationHeaders:
				if not notice.get(header, False):
					raise errors.ParseError('Missing Notification Header: ' + header)
1302082
def WriteUserNotification(self, notification):
    """"""
    if notification.username not in self.users:
      raise db.UnknownGRRUserError(notification.username)

    cloned_notification = notification.Copy()
    if not cloned_notification.timestamp:
      cloned_notification.timestamp = rdfvalue.RDFDatetime.Now()

    self.notifications_by_username.setdefault(cloned_notification.username,
                                              []).append(cloned_notification)