Create a notification.
544319
def create(self, **kwargs):
        """"""
        body = self.client.create(url=self.base_url,
                                  json=kwargs)
        return body
1155058
def notify_message(self, message, level="info", clear_if_dupl=True,
                       clear_in=CLEAR_NOTIF_BAR_MESSAGE_IN):
        
        with self.notifications_lock:
            if clear_if_dupl and message in self.message_widget_dict.keys():
                logger.debug("notification %r is already displayed", message)
                return
            logger.debug("display notification %r", message)
            widget = urwid.AttrMap(urwid.Text(message), "notif_{}".format(level))
        return self.notify_widget(widget, message=message, clear_in=clear_in)
196898
def notify(self, data):
        """"""
        triggered_channels = []
        for channel_name, items in data.items():
            for item in items or []:
                LOG.debug('notify received: %s', item)
                try:
                    # some channels return strings rather than objects (e.g. de-registrations),
                    # normalize them here
                    item = {'value': item} if isinstance(item, six.string_types) else dict(item)
                    # inject the channel name to the data (so channels can filter on it)
                    item['channel'] = channel_name
                    triggered_channels.extend(list(self._notify_single_item(item)))
                except Exception:  # noqa
                    LOG.exception('Subscription notification failed')
        return triggered_channels
1328843
def create_notification(self, notification_type, label=None, name=None,
            details=None):
        
        return self._notification_manager.create(notification_type,
                label=label, name=name, details=details)
817350
def notify(self, topic, **kwargs):
        '''
        
        '''
        kwargs['name'] = self._name
        self._engine._notify(topic, **kwargs)
619134
def create_alarm(self, check, notification_plan, criteria=None,
            disabled=False, label=None, name=None, metadata=None):
        
        return self._alarm_manager.create(check, notification_plan,
                criteria=criteria, disabled=disabled, label=label, name=name,
                metadata=metadata)
36658
def notify(cls, user_or_email, instance):
        """"""
        return super(InstanceEvent, cls).notify(user_or_email,
                                                object_id=instance.pk)
578710
def send_notification(self, title, message, typ=1, url=None, sender=None):
        
        self.user.send_notification(title=title, message=message, typ=typ, url=url,
                                    sender=sender)
6912
def _notify(self, data):
        """"""
        payload = tlv.decode(
            payload=data.get('payload'),
            content_type=data.get('ct'),
            decode_b64=True
        )
        super(CurrentResourceValue, self)._notify(payload)
        # after one response, close the channel
        self.ensure_stopped()
573778
def WriteUserNotification(self, notification, cursor=None):
    """"""
    # Copy the notification to ensure we don't modify the source object.
    args = {
        "username_hash":
            mysql_utils.Hash(notification.username),
        "notification_state":
            int(notification.state),
        "notification":
            notification.SerializeToString(),
    }
    query = "INSERT INTO user_notification {columns} VALUES {values}".format(
        columns=mysql_utils.Columns(args),
        values=mysql_utils.NamedPlaceholders(args))
    try:
      cursor.execute(query, args)
    except MySQLdb.IntegrityError:
      raise db.UnknownGRRUserError(notification.username)
467392
def set_message(self, title, msg, typ, url=None):
        
        return self.user.send_notification(title=title,
                                           message=msg,
                                           typ=typ,
                                           url=url)
177684
public CreateNotificationResponse createNotification(String name, String endpoint) {
        CreateNotificationRequest request = new CreateNotificationRequest();
        request.withName(name).withEndpoint(endpoint);
        return createNotification(request);
    }
338740
def NotifyQueue(self, notification, **kwargs):
    """"""
    self._MultiNotifyQueue(notification.session_id.Queue(), [notification],
                           **kwargs)
236174
def show_notification(cls, channel_id, *args, **kwargs):
        
        app = AndroidApplication.instance()
        builder = Notification.Builder(app, channel_id)
        builder.update(*args, **kwargs)
        return builder.show()
931787
def set_notification_callback(self, notification_cb):
    """"""
    self._notification_cb = notification_cb
    if not notification_cb and self.dimensions:
      self.measured_value.notify_value_set = None
    return self
519510
public static void addNotification(Notification n) {
        NotificationManager.notifications.add(n);
        logger.fine("New notification added to notifications list. There is currently: " +
                    notifications.size()+" notifications\n Notification added: "
                    +NotificationManager.notifications.get(NotificationManager.notifications.size()-1));
    }
332263
function(title, message, cb, okText) {
    cb = cb || function() {};
    title = title || '';
    okText = okText || gettextCatalog.getString('OK');
    $window.top.navigator.notification.alert(message, cb, title, okText);
  }