Display a notification following the specified format
356968
def on_click(self, event):
        
        if not self.notification:
            return

        if self.charging:
            format = self.format_notify_charging
        else:
            format = self.format_notify_discharging

        message = self.py3.safe_format(
            format,
            dict(
                ascii_bar=self.ascii_bar,
                icon=self.icon,
                percent=self.percent_charged,
                time_remaining=self.time_remaining,
            ),
        )

        if message:
            self.py3.notify_user(message, "info")
923636
function show_notification(msg, type, reload_page, timeout){
    // defaults to false
    reload_page = reload_page || false;
    timeout = timeout || 3000;

    $('#notify_message').removeClass();
    $('#notify_message').addClass('notify_message-' + type);
    $('#notify_message').html(msg);
    $('#notify_message').slideDown(600).delay(timeout).slideUp(600, function(){
        if(reload_page === true){
            location.reload();
        }
    });
}
668723
def notification_message(self, title, content, icon=""):
        
        code = """
            var options = {
                body: "%(content)s",
                icon: "%(icon)s"
            }
            if (!("Notification" in window)) {
                alert("%(content)s");
            }else if (Notification.permission === "granted") {
                var notification = new Notification("%(title)s", options);
            }else if (Notification.permission !== 'denied') {
                Notification.requestPermission(function (permission) {
                    if (permission === "granted") {
                        var notification = new Notification("%(title)s", options);
                    }
                });
            }
        """ % {'title': title, 'content': content, 'icon': icon}
        self.execute_javascript(code)
963098
def display_line(self):
        """"""
        msg = ["Image {0}".format(self.name)]
        if self.image_index:
            msg.append("Pushes to {0}".format(self.image_name))
        return ' : '.join(msg)
717006
def do_notification_show(mc, args):
    ''''''
    fields = {}
    fields['notification_id'] = args.id
    try:
        notification = mc.notifications.get(**fields)
    except (osc_exc.ClientException, k_exc.HttpError) as he:
        raise osc_exc.CommandError('%s\n%s' % (he.message, he.details))
    else:
        if args.json:
            print(utils.json_formatter(notification))
            return
        formatters = {
            'name': utils.json_formatter,
            'id': utils.json_formatter,
            'type': utils.json_formatter,
            'address': utils.json_formatter,
            'period': utils.json_formatter,
            'links': utils.format_dictlist,
        }
        utils.print_dict(notification, formatters=formatters)
1022831
private function print_notification( $notice ) {
        do_action( 'easy_notifications_before_notice', $notice ); 

        echo '<div class="updated '.$notice['type'].'">
            ' . $notice['content'] . ' 

            <a href="#" class="dismiss-notice" 
            data-namespace="' . $this->prefix . '" 
            data-noticeid="' . $notice['id'] . '"
            >Dismiss Notification</a>
            </div>';

        do_action( 'easy_notifications_after_notice', $notice );
    }
800837
def send_notify(self, playingsong, content=''):
        ''''''
        title = playingsong['title'].decode('utf-8')
        content = content.decode('utf-8')
        if title == self.title:
            if self.has_cover:
                send_notification(self.title, content, self.cover_file.name)
            else:
                send_notification(self.title, content)
        else:
            self.init_notification(playingsong)
            self.title = title
895083
def _notification_stmt(self, stmt: Statement, sctx: SchemaContext) -> None:
        """"""
        self._handle_child(NotificationNode(), stmt, sctx)
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)
1235949
def display_message(
        self, subject='Find My iPhone Alert', message="This is a note",
        sounds=False
    ):
        
        data = json.dumps(
            {
                'device': self.content['id'],
                'subject': subject,
                'sound': sounds,
                'userText': True,
                'text': message
            }
        )
        self.session.post(
            self.message_url,
            params=self.params,
            data=data
        )
75316
def handleNotification(self, handle, data):
        """"""
        _LOGGER.debug("Got notification from %s: %s", handle, codecs.encode(data, 'hex'))
        if handle in self._callbacks:
            self._callbacks[handle](data)
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);
  }
440213
def Message(message, title='FontParts', informativeText=""):
    
    return dispatcher["Message"](message=message, title=title,
                                 informativeText=informativeText)
358372
public void displayWarning(final String message) {
        notificationMessage.showNotification(SPUIStyleDefinitions.SP_NOTIFICATION_WARNING_MESSAGE_STYLE, null, message,
                true);
    }
160925
def show(self, msg, indent=0, style="", **kwargs):
        
        if self.enable_verbose:
            new_msg = self.MessageTemplate.with_style.format(
                indent=self.tab * indent,
                style=style,
                msg=msg,
            )
            print(new_msg, **kwargs)
1098294
def _notify_receiver(self, receiver, params, doc):
        """"""
        verb = VMAP[doc['op']]
        ns = doc['ns']
        notification_id = Id(ns + 'Notification:' + str(ObjectId()) + '@' + params['authority'])
        object_id = Id(ns + ':' + str(doc['o']['_id']) + '@' + params['authority'])
        try:
            getattr(receiver, '_'.join([verb, params['obj_name_plural']]))(notification_id, [object_id])
        except AttributeError:
            pass
        return notification_id
543222
function Notification (payload) {
  this.encoding = "utf8";
  this.payload = {};
  this.compiled = false;

  this.aps = {};
  this.expiry = 0;
  this.priority = 10;

  if (payload) {
    for(let key in payload) {
      if (payload.hasOwnProperty(key)) {
        this[key] = payload[key];
      }
    }
  }
}