Show alerts at the given alert level.
431083
def show_alerts(zap_helper, alert_level, output_format, exit_code):
    """"""
    alerts = zap_helper.alerts(alert_level)

    helpers.report_alerts(alerts, output_format)

    if exit_code:
        code = 1 if len(alerts) > 0 else 0
        sys.exit(code)
165959
def notify(self, level, value, target=None, ntype=None, rule=None):
        """"""
        # Did we see the event before?
        if target in self.state and level == self.state[target]:
            return False

        # Do we see the event first time?
        if target not in self.state and level == 'normal' \
                and not self.reactor.options['send_initial']:
            return False

        self.state[target] = level
        return self.reactor.notify(level, self, value, target=target, ntype=ntype, rule=rule)
966489
public Optional<InfraAlertCondition> show(long conditionId)
    {
        return HTTP.GET(String.format("/v2/alerts/conditions/%d", conditionId), null, null, INFRA_ALERT_CONDITION);
    }
1092997
public static Optional<ButtonType> alert(String title, String header, String content, AlertType alertType,
                                             Modality modality, Window window, StageStyle style) {
        return getAlert(title, header, content, alertType, modality, window, style).showAndWait();
    }
911036
def log_message(self, kind, alert):
        """"""
        if kind == 'ERROR':
            logging.error(alert)
        else:
            logging.warning(alert)
        return
799379
public Collection<AlertPolicy> list(String name)
    {
        return list(filters().name(name).build());
    }
745393
def do_stop_alerts(self, _):
        
        self._stop_thread = True
        if self._alerter_thread.is_alive():
            self._alerter_thread.join()
        else:
            print("The alert thread is already stopped")
897058
public void alert(final int title, final int message) {
        new AlertDialog.Builder(getContext());
        alert(getContext().getString(title),
                getContext().getString(message));
    }
941986
function (alertInfo, debugInfo) {
        const editor = this.editor
        const debug = editor.config.debug
        const customAlert = editor.config.customAlert

        if (debug) {
            throw new Error('wangEditor: ' + (debugInfo || alertInfo))
        } else {
            if (customAlert && typeof customAlert === 'function') {
                customAlert(alertInfo)
            } else {
                alert(alertInfo)
            }
        }
    }
759952
def alert(msg,body="",icon=None):
    
    if type(body) == str:
        body = body[:200]
    if call(["which","notify-send"]) == 0:
        if icon is not None:
            call(["notify-send",msg,"-i",icon,body])
        else:
            call(["notify-send",msg,body])
    else:
        print(("ALERT: ", msg))
652455
private void calculateHighestAlert() {
        synchronized (alerts) {
            highestAlert = null;
            for (Alert alert : alerts) {
                if (isHighestAlert(alert)) {
                    highestAlert = alert;
                }
            }
            calculateHighestAlert = false;
        }
    }
494615
def show_error(self, *messages):
        """"""
        if not self.quiet:
            self.display(messages, main_sig, debug=True)
79078
def alertingNetToMs(Facility_presence=0, ProgressIndicator_presence=0,
                    UserUser_presence=0):
    """"""
    a = TpPd(pd=0x3)
    b = MessageType(mesType=0x1)  # 00000001
    packet = a / b
    if Facility_presence is 1:
        c = FacilityHdr(ieiF=0x1C)
        packet = packet / c
    if ProgressIndicator_presence is 1:
        d = ProgressIndicatorHdr(ieiPI=0x1E)
        packet = packet / d
    if UserUser_presence is 1:
        e = UserUserHdr(ieiUU=0x7E)
        packet = packet / e
    return packet
544534
def do_alarm_show(mc, args):
    ''''''
    fields = {}
    fields['alarm_id'] = args.id
    try:
        alarm = mc.alarms.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(alarm))
            return
        # print out detail of a single alarm
        formatters = {
            'id': utils.json_formatter,
            'alarm_definition': utils.json_formatter,
            'metrics': utils.json_formatter,
            'state': utils.json_formatter,
            'links': utils.format_dictlist,
        }
        utils.print_dict(alarm, formatters=formatters)
764267
private List<Alert> getAlertsObj(String alertname, PrincipalUser owner, boolean shared, boolean populateMetaFieldsOnly, Integer limit) {
		
		Set<Alert> result = new HashSet<>();
		
		result.addAll(_getAlertsByOwner(alertname, owner, populateMetaFieldsOnly));
		if(shared) {
			result.addAll(populateMetaFieldsOnly ? alertService.findSharedAlerts(true, null, limit) : alertService.findSharedAlerts(false, null, limit));
		}
		
		return new ArrayList<>(result);
	}
401385
def emit(self):
        """"""

        self.count += 1

        # event_name = 'on_{0}'.format(self.context.subcategory.lower())
        event_name = self.context.subcategory
        if hasattr(self.handler, event_name):
            getattr(self.handler, event_name)(self.context)
        elif hasattr(self.handler, 'default'):
            self.handler.default(self.context)
359421
def display(level='DEBUG'):
    """"""
    logger = get_logger()
    sh = logging.StreamHandler()
    sh.setLevel(getattr(logging, level))
    sh.setFormatter(DEFAULT_LOG_FORMAT)
    logger.addHandler(sh)