send a notice to client
340367
def notice(self, client, message):
        """"""
        if client and message:
            messages = utils.split_message(message, self.config.max_length)
            for msg in messages:
                client.fwrite(':{c.srv} NOTICE {c.nick} :{msg}', msg=msg)
222820
def send_bounced_warning(person, leader_list):
    """"""
    context = CONTEXT.copy()
    context['person'] = person

    for lp in leader_list:
        leader = lp['leader']

        context['project'] = lp['project']
        context['receiver'] = leader

        to_email = leader.email
        subject = render_to_string(
            'karaage/people/emails/bounced_email_subject.txt', context)
        body = render_to_string(
            'karaage/people/emails/bounced_email_body.txt', context)
        send_mail(
            subject.replace('\n', ''), body,
            settings.ACCOUNTS_EMAIL, [to_email])
        log.change(
            leader,
            'Sent email about bounced emails from %s' % person)
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)
1056808
def _agent_notification(self, context, method, hosting_devices, operation):
        """"""
        admin_context = context.is_admin and context or context.elevated()
        for hosting_device in hosting_devices:
            agents = self._dmplugin.get_cfg_agents_for_hosting_devices(
                admin_context, hosting_device['id'], admin_state_up=True,
                schedule=True)
            for agent in agents:
                LOG.debug('Notify %(agent_type)s at %(topic)s.%(host)s the '
                          'message %(method)s',
                          {'agent_type': agent.agent_type,
                           'topic': agent.topic,
                           'host': agent.host,
                           'method': method})
                cctxt = self.client.prepare(server=agent.host)
                cctxt.cast(context, method)
503343
async def message(self, recipient: str, text: str, notice: bool=False) -> None:
        
        await self._send(cc.PRIVMSG if not notice else cc.NOTICE, recipient, rest=text)
244128
def _Notify(username, notification_type, message, object_reference):
  """"""

  # Do not try to notify system users (e.g. Cron).
  if username in aff4_users.GRRUser.SYSTEM_USERS:
    return

  if object_reference:
    uc = object_reference.UnionCast()
    if hasattr(uc, "client_id"):
      message = _HostPrefix(uc.client_id) + message

  n = rdf_objects.UserNotification(
      username=username,
      notification_type=notification_type,
      state=rdf_objects.UserNotification.State.STATE_PENDING,
      message=message,
      reference=object_reference)
  data_store.REL_DB.WriteUserNotification(n)
752585
def notify_change(self, change):
        """"""
        # Send the state to the frontend before the user-registered callbacks
        # are called.
        name = change['name']
        if self.comm is not None and self.comm.kernel is not None:
            # Make sure this isn't information that the front-end just sent us.
            if name in self.keys and self._should_send_property(name, getattr(self, name)):
                # Send new state to front-end
                self.send_state(key=name)
        super(Widget, self).notify_change(change)
1083918
def _send_event(self, title, text, tags, event_type, aggregation_key, severity='info'):
        """"""
        event_dict = {
            'timestamp': int(time()),
            'source_type_name': self.SOURCE_TYPE_NAME,
            'msg_title': title,
            'event_type': event_type,
            'alert_type': severity,
            'msg_text': text,
            'tags': tags,
            'aggregation_key': aggregation_key,
        }
        self.event(event_dict)
425466
def notify():
    """"""
    a = TpPd(pd=0x3)
    b = MessageType(mesType=0x3e)  # 00111110
    c = NotificationIndicator()
    packet = a / b / c
    return packet
1247733
def notify(self, msgtype, method, params):
        """"""
        self.dispatch.call(method, params)
772405
def do_notify(self, line):
        

        def f(p, method, params):
            p.send_notification(method, params)

        self._request(line, f)
400844
public function sendNotice($notice)
    {
        $notice = $this->filterNotice($notice);
        if (isset($notice['error'])) {
            return $notice;
        }

        if (time() < $this->rateLimitReset) {
            $notice['error'] = ERR_IP_RATE_LIMITED;
            return $notice;
        }

        $req = $this->newHttpRequest($notice);
        $resp = $this->sendRequest($req);
        return $this->processHttpResponse($notice, $resp);
    }
1285036
def notify(self, level, alert, value, target=None, ntype=None, rule=None):
        

        LOGGER.info('Notify %s:%s:%s:%s', level, alert, value, target or "")

        if ntype is None:
            ntype = alert.source

        for handler in self.handlers.get(level, []):
            handler.notify(level, alert, value, target=target, ntype=ntype, rule=rule)
173811
def post(self):
    """"""
    client_customer_id = self.request.get('clientCustomerId')
    if not client_customer_id:
      self.redirect('/')
    else:
      self.redirect('/showCampaigns?clientCustomerId=%s' % client_customer_id)
441623
async def send_event(self, client_id, service_name, event_name, event_info, directed_client=None):
        """"""

        if directed_client is not None and directed_client != client_id:
            return

        client_info = self.clients.get(client_id)
        if client_info is None:
            self._logger.warning("Attempted to send event to invalid client id: %s", client_id)
            return

        conn = client_info['connection']

        event = dict(service=service_name)
        if event_info is not None:
            event['payload'] = event_info

        self._logger.debug("Sending event: %s", event)

        await self.server.send_event(conn, event_name, event)
380958
function send() {
		// Check form for errors
		if(!$("#transaction").val()) return alert('Missing parameter !');

		// Send
		nem.com.requests.transaction.announce(endpoint, $("#transaction").val()).then(function(res) {
			// If code >= 2, it's an error
			if (res.code >= 2) {
				alert(res.message);
			} else {
				alert(res.message);
			}
		}, function(err) {
			alert(err);
		})
	}
59225
def notify_listeners(self, msg_type, params):
        """"""
        for c in self.listeners:
            c.notify(msg_type, params)