Filters a list of pushed notifications and returns only the ones that were successful.

@param notifications a list of pushed notifications
@return a filtered list containing only notifications that were succcessful
336582
public static List<PushedNotification> findSuccessfulNotifications(List<PushedNotification> notifications) {
		List<PushedNotification> filteredList = new Vector<PushedNotification>();
		for (PushedNotification notification : notifications) {
			if (notification.isSuccessful()) filteredList.add(notification);
		}
		return filteredList;
	}
760059
protected Collection<CmsContentNotification> getContentNotifications() throws CmsException {

        // get all owners for the resource
        Iterator<CmsExtendedNotificationCause> notificationCandidates = m_resources.iterator();
        Map<CmsUser, CmsContentNotification> result = new HashMap<CmsUser, CmsContentNotification>();
        while (notificationCandidates.hasNext()) {
            CmsExtendedNotificationCause resourceInfo = notificationCandidates.next();
            CmsResource resource = resourceInfo.getResource();
            // skip, if content notification is not enabled for this resource
            String enableNotification = m_cms.readPropertyObject(
                resource,
                CmsPropertyDefinition.PROPERTY_ENABLE_NOTIFICATION,
                true).getValue();
            if (Boolean.valueOf(enableNotification).booleanValue()) {
                try {
                    Iterator<CmsUser> responsibles = m_cms.readResponsibleUsers(resource).iterator();
                    while (responsibles.hasNext()) {
                        CmsUser responsible = responsibles.next();
                        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(responsible.getEmail())) {
                            // check, if resultset already contains a content notification for the user
                            CmsContentNotification contentNotification = result.get(responsible);

                            // if not add a new content notification
                            if (contentNotification == null) {
                                contentNotification = new CmsContentNotification(responsible, m_cms);
                                result.put(responsible, contentNotification);
                            }
                            List<CmsExtendedNotificationCause> resourcesForResponsible = contentNotification.getNotificationCauses();
                            if (resourcesForResponsible == null) {
                                resourcesForResponsible = new ArrayList<CmsExtendedNotificationCause>();
                                contentNotification.setNotificationCauses(resourcesForResponsible);
                            }
                            resourcesForResponsible.add(resourceInfo);
                        }
                    }
                } catch (CmsException e) {
                    if (LOG.isInfoEnabled()) {
                        LOG.error(e.getLocalizedMessage(), e);
                    }
                }
            }
        }
        return result.values();
    }
1165515
async def get_notifications(self) -> List[Notification]:
        
        notifications = []
        for serv in self.services:
            for notification in self.services[serv].notifications:
                notifications.append(notification)
        return notifications
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)
979821
public static int processResponses(PushNotificationManager notificationManager) {
		List<ResponsePacket> responses = readResponses(notificationManager.getActiveSocket());
		handleResponses(responses, notificationManager);
		return responses.size();
	}
183404
def objects_for_push_notification(notification):
    
    notification_el = ElementTree.fromstring(notification)
    objects = {'type': notification_el.tag}
    for child_el in notification_el:
        tag = child_el.tag
        res = Resource.value_for_element(child_el)
        objects[tag] = res
    return objects
18746
def get_notifications(self, start=None, stop=None, *args, **kwargs):
        
        filter_kwargs = {}
        # Todo: Also support sequencing by 'position' if items are sequenced by timestamp?
        if start is not None:
            filter_kwargs['%s__gte' % self.notification_id_name] = start + 1
        if stop is not None:
            filter_kwargs['%s__lt' % self.notification_id_name] = stop + 1
        objects = self.record_class.objects.filter(**filter_kwargs)

        if hasattr(self.record_class, 'application_name'):
            objects = objects.filter(application_name=self.application_name)
        if hasattr(self.record_class, 'pipeline_id'):
            objects = objects.filter(pipeline_id=self.pipeline_id)

        objects = objects.order_by('%s' % self.notification_id_name)
        return objects.all()
584638
public static function getAllNotificationsToDisplay()
    {
        $notifications = static::getAllNotifications();

        uasort($notifications, function ($n1, $n2) {
            /** @var Notification $n1 */ /** @var Notification $n2 */
            if ($n1->getPriority() == $n2->getPriority()) {
                return 0;
            }

            return $n1->getPriority() > $n2->getPriority() ? -1 : 1;
        });

        return $notifications;
    }
1208346
public java.util.List<NotificationConfiguration> getNotificationConfigurations() {
        if (notificationConfigurations == null) {
            notificationConfigurations = new com.amazonaws.internal.SdkInternalList<NotificationConfiguration>();
        }
        return notificationConfigurations;
    }
292703
public List<Notification> getBySource(Object source) {
        List<Notification> found = new ArrayList<Notification>();
        for (Notification n: NotificationManager.notifications)
            if (n.getSource().equals(source)) {
                logger.fine("...found a match for getBySource query. With source: "+source);
                found.add(n);
            }
        if(found.size()>0)        
            return found;
        return null;
    }
661110
public void onNotificationsResumed() {
        isNotificationsPaused = false;

        // If there are notifications during pause
        if (notificationsDuringPause.size() > 0) {

            if (isAppVisible) {
                if (visiblePeer != null && notificationsDuringPause.containsKey(visiblePeer)) {

                    // If there was message from visible chat
                    if (isMobilePlatform) {

                        // Playing sound effects for mobile platforms
                        playEffectIfEnabled();
                    } else {

                        // Don't play sounds in chat on non-mobile platforms
                    }
                } else {

                    // If there are no messages from visible peer
                    if (isMobilePlatform) {

                        // Don't play sounds not from current chat on mobile platforms
                    } else {

                        // Find any suitable peer and if found play sound effect
                        for (Peer p : notificationsDuringPause.keySet()) {

                            if (isNotificationsEnabled(p, notificationsDuringPause.get(p))) {
                                playEffectIfEnabled();
                                break; // Can't do return because we need to make more work later
                            }
                        }
                    }
                }
            } else {

                // Just show out-app notification
                for (Peer p : notificationsDuringPause.keySet()) {

                    if (isNotificationsEnabled(p, notificationsDuringPause.get(p))) {
                        showNotification();
                        break;
                    }
                }
            }

            // Clearing of notifications
            notificationsDuringPause.clear();
        }
    }
774262
@Override
	public List<CommerceNotificationAttachment> findAll() {
		return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}
342030
@Override
	public List<CommerceNotificationQueueEntry> findByLtS(Date sentDate) {
		return findByLtS(sentDate, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}
935054
public function addNotifications(array $notifications)
    {
        foreach ($notifications as $notification) {
            if (in_array($notification, $this->notifications, true)) {
                continue;
            }

            $this->addNotification($notification);
        }
    }
513513
def get_notifications(user):
    ''''''
    notifications = []

    for name, func in _providers.items():
        notifications.extend([{
            'type': name,
            'created_on': dt,
            'details': details
        } for dt, details in func(user)])

    return notifications
285011
def DeletePendingNotification(self, timestamp):
    
    shown_notifications = self.Get(self.Schema.SHOWN_NOTIFICATIONS)
    if not shown_notifications:
      shown_notifications = self.Schema.SHOWN_NOTIFICATIONS()

    pending = self.Get(self.Schema.PENDING_NOTIFICATIONS)
    if not pending:
      return

    # Remove all notifications with the given timestamp from pending
    # and add them to the shown notifications.
    delete_count = 0
    for idx in reversed(range(0, len(pending))):
      if pending[idx].timestamp == timestamp:
        shown_notifications.Append(pending[idx])
        pending.Pop(idx)
        delete_count += 1

    if delete_count > 1:
      raise UniqueKeyError("Multiple notifications at %s" % timestamp)

    self.Set(self.Schema.PENDING_NOTIFICATIONS, pending)
    self.Set(self.Schema.SHOWN_NOTIFICATIONS, shown_notifications)
1182807
public List<Notification> getByInteraction(String interaction) {
        List<Notification> found = new ArrayList<Notification>();
        for (Notification n: NotificationManager.notifications)
            if (((InteractionNotification)n).getInteraction().equals(interaction)){ 
                logger.fine("...found a match for getByInteraction query. With interaction: " +
                            interaction);
                found.add(n);
            }
        if(found.size()>0)        
            return found;
        return null;
    }