https://developers.coinbase.com/api/v2#show-a-notification
326675
def get_notification(self, notification_id, **params):
        """"""
        response = self._get('v2', 'notifications', notification_id, params=params)
        return self._make_api_object(response, Notification)
15245
def notify(*options, &block)
      raise "Couldn't create notifications without a block" unless block_given?

      conditions = *options
      conditions = DEFAULT_NOTIFICATIONS if options.empty?

      conditions.each do |condition|
        notification = Notification.new(condition)
        notification.instance_eval(&block)

        @notifications[condition] = notification
      end
    end
1209990
def notify_user(self, msg, level="info", rate_limit=5, title=None, icon=None):
        
        module_name = self._module.module_full_name
        if isinstance(msg, Composite):
            msg = msg.text()
        if title is None:
            title = "py3status: {}".format(module_name)
        elif isinstance(title, Composite):
            title = title.text()
        # force unicode for python2 str
        if self._is_python_2:
            if isinstance(msg, str):
                msg = msg.decode("utf-8")
            if isinstance(title, str):
                title = title.decode("utf-8")
        if msg:
            self._py3_wrapper.notify_user(
                msg=msg,
                level=level,
                rate_limit=rate_limit,
                module_name=module_name,
                title=title,
                icon=icon,
            )
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];
      }
    }
  }
}
891197
def _on_notification(self, name, args):
        """"""
        if IS_PYTHON3:
            name = decode_if_bytes(name)
        handler = self._notification_handlers.get(name, None)
        if not handler:
            msg = self._missing_handler_error(name, 'notification')
            error(msg)
            self._on_async_err(msg + "\n")
            return

        debug('calling notification handler for "%s", args: "%s"', name, args)
        handler(*args)
624430
function postNotification(Notification $n)
	{
		if($n->receiverName)
		{
			if($n->isPrivate)
			{
				return $this->manialinkPublisher->postPrivateNotification($n->message, $n->receiverName);
			}
			return $this->manialinkPublisher->postPersonalNotification($n->message, $n->link, $n->iconStyle, $n->iconSubStyle);
		}
		return $this->manialinkPublisher->postPublicNotification($n->message, $n->link, $n->iconStyle, $n->iconSubStyle);
	}
503065
def handle_notification(self, data):
        """"""
        if data.get('method') in self._callbacks:
            self._callbacks.get(data.get('method'))(data.get('params'))
1323137
def notify(self, instance=None, **kwargs):
        
        notified = {}
        for notification_cls in self.registry.values():
            notification = notification_cls()
            if notification.notify(instance=instance, **kwargs):
                notified.update({notification_cls.name: instance._meta.label_lower})
        return notified
896594
function handleNotificationThatWalletFullyApproved(wallet, device_address, onDone){
	db.query( // just in case it was not inserted yet
		"INSERT "+db.getIgnore()+" INTO extended_pubkeys (wallet, device_address) VALUES(?,?)",
		[wallet, device_address],
		function(){
			db.query(
				"UPDATE extended_pubkeys SET member_ready_date="+db.getNow()+" WHERE wallet=? AND device_address=?", 
				[wallet, device_address],
				function(){
					checkAndFinalizeWallet(wallet, onDone);
				}
			);
		}
	);
}
286519
def notify_user(
        self,
        msg,
        level="error",
        rate_limit=None,
        module_name="",
        icon=None,
        title="py3status",
    ):
        
        dbus = self.config.get("dbus_notify")
        if dbus:
            # force msg, icon, title to be a string
            title = u"{}".format(title)
            msg = u"{}".format(msg)
            if icon:
                icon = u"{}".format(icon)
        else:
            msg = u"py3status: {}".format(msg)
        if level != "info" and module_name == "":
            fix_msg = u"{} Please try to fix this and reload i3wm (Mod+Shift+R)"
            msg = fix_msg.format(msg)
        # Rate limiting. If rate limiting then we need to calculate the time
        # period for which the message should not be repeated.  We just use
        # A simple chunked time model where a message cannot be repeated in a
        # given time period. Messages can be repeated more frequently but must
        # be in different time periods.

        limit_key = ""
        if rate_limit:
            try:
                limit_key = time.time() // rate_limit
            except TypeError:
                pass
        # We use a hash to see if the message is being repeated.  This is crude
        # and imperfect but should work for our needs.
        msg_hash = hash(u"{}#{}#{}#{}".format(module_name, limit_key, msg, title))
        if msg_hash in self.notified_messages:
            return
        elif module_name:
            log_msg = 'Module `%s` sent a notification. "%s: %s"' % (
                module_name,
                title,
                msg,
            )
            self.log(log_msg, level)
        else:
            self.log(msg, level)
        self.notified_messages.add(msg_hash)

        try:
            if dbus:
                # fix any html entities
                msg = msg.replace("&", "&amp;")
                msg = msg.replace("<", "&lt;")
                msg = msg.replace(">", "&gt;")
                cmd = ["notify-send"]
                if icon:
                    cmd += ["-i", icon]
                cmd += ["-u", DBUS_LEVELS.get(level, "normal"), "-t", "10000"]
                cmd += [title, msg]
            else:
                py3_config = self.config.get("py3_config", {})
                nagbar_font = py3_config.get("py3status", {}).get("nagbar_font")
                wm_nag = self.config["wm"]["nag"]
                cmd = [wm_nag, "-m", msg, "-t", level]
                if nagbar_font:
                    cmd += ["-f", nagbar_font]
            Popen(cmd, stdout=open("/dev/null", "w"), stderr=open("/dev/null", "w"))
        except Exception as err:
            self.log("notify_user error: %s" % err)
901373
function showNotification(data) {
  if (!data || !data.tag) {
    // eslint-disable-next-line no-param-reassign
    data = $Notifications.default;
  }
  logger.group(data.tag);
  logger.log('Show notification.', data.tag);
  return self.registration
    .showNotification(data.title, data)
    .then(delayDismissNotification);
}
648601
function show(options) {
    if (!options.message) {
      return;
    }

    prepare_();

    let notify = null;

    const time = options.time || 8000;

    switch (options.type) {
      case 'confirm':
        notify = draw.confirm(options);
        break;

      case 'prompt':
        notify = draw.prompt(options);
        break;

      default:
        notify = draw.alert(options);

        window.setTimeout(function () {
          notify.remove();
        }, time);
    }

    wrapper_.appendChild(notify);
    notify.classList.add(bounceInClass);
  }
797408
def notification_push(dev_type, to, message=None, **kwargs):
    
    key = {
        'ANDROID': settings.GCM_ANDROID_APIKEY,
        'IOS': settings.GCM_IOS_APIKEY
    }

    if not key[dev_type]:
        raise ImproperlyConfigured(
            "You haven't set the 'GCM_{}_APIKEY' setting yet.".format(dev_type))

    payload = {
        'ANDROID': {'to': to,
                    'data': {'message': message}},
        'IOS': {
            'to': to,
            'notification': {
                'body': message,
            },
        }
    }

    payload[dev_type].update(**kwargs)

    payload = json.dumps(payload[dev_type])

    headers = {'Authorization': 'key={}'.format(key[dev_type]), 'Content-Type': 'application/json'}

    response = requests.post(url='https://gcm-http.googleapis.com/gcm/send',
                             data=payload,
                             headers=headers
                             )

    if response.status_code == 200:

        response = response.json()

        if response['success']:
            return {'success': 'Message send successfully'}
        elif response['canonical_ids']:
            return {'canonical_id': response.get('results')[0].get('registration_id')}
        elif response['failure']:
            return {'error': response.get('results')[0].get('error')}

    elif 400 <= response.status_code < 500:
        return {'error': '%s Client Error: %s' % (response.status_code, response.reason)}

    elif 500 <= response.status_code < 600:
        return {'error': '%s Server Error: %s' % (response.status_code, response.reason)}
1015269
def notify(title,
           message,
           api_key=NTFY_API_KEY,
           provider_key=None,
           priority=0,
           url=None,
           retcode=None):
    

    data = {
        'apikey': api_key,
        'application': 'ntfy',
        'event': title,
        'description': message,
    }

    if MIN_PRIORITY <= priority <= MAX_PRIORITY:
        data['priority'] = priority
    else:
        raise ValueError('priority must be an integer from {:d} to {:d}'
                         .format(MIN_PRIORITY, MAX_PRIORITY))

    if url is not None:
        data['url'] = url

    if provider_key is not None:
        data['providerkey'] = provider_key

    resp = requests.post(
        API_URL, data=data, headers={
            'User-Agent': USER_AGENT,
        })

    resp.raise_for_status()
799157
def notifications(self):
        """"""
        self.__init()
        items = []
        for n in self._notifications:
            if "id" in n:
                url = "%s/%s" % (self.root, n['id'])
                items.append(self.Notification(url=url,
                                               securityHandler=self._securityHandler,
                                               proxy_url=self._proxy_url,
                                               proxy_port=self._proxy_port))
        return items
1352617
private Notification buildNotification() {
        Notification notification = mNotificationBuilder.build();
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
            notification.bigContentView = mNotificationExpandedView;
        }
        return notification;
    }
87191
def NotifyAboutEnd(self):
    """"""
    flow_ref = None
    if self.runner_args.client_id:
      flow_ref = rdf_objects.FlowReference(
          client_id=self.client_id, flow_id=self.urn.Basename())

    num_results = len(self.ResultCollection())
    notification_lib.Notify(
        self.creator, rdf_objects.UserNotification.Type.TYPE_FLOW_RUN_COMPLETED,
        "Flow %s completed with %d %s" %
        (self.__class__.__name__, num_results, num_results == 1 and "result" or
         "results"),
        rdf_objects.ObjectReference(
            reference_type=rdf_objects.ObjectReference.Type.FLOW,
            flow=flow_ref))