Watch for new alerts.
504675
def cli(ctx, ids, query, filters, details, interval):
    """"""
    if details:
        display = 'details'
    else:
        display = 'compact'
    from_date = None

    auto_refresh = True
    while auto_refresh:
        try:
            auto_refresh, from_date = ctx.invoke(query_cmd, ids=ids, query=query,
                                                 filters=filters, display=display, from_date=from_date)
            time.sleep(interval)
        except (KeyboardInterrupt, SystemExit) as e:
            sys.exit(e)
614416
def notify_update(self):
    """"""
    with self._lock:
      for event in self._update_events:
        event.set()
      self._update_events.clear()
1348940
private void notifyListenersIfUninhibited(R oldValue, R newValue) {
        if (inhibited) {
            inhibitCount++;
            lastInhibitedValue = newValue;
        } else {
            lastInhibitedValue = newValue; // Just in case, even though not really necessary
            lastNonInhibitedValue = newValue;
            doNotifyListeners(oldValue, newValue);
        }
    }
725392
def check_alerts(self):
        """"""

        alerted = []

        for alert_time, task in self.alerts.items():
            task_time = dateutil.parser.parse(alert_time)
            if task_time < get_time():
                self.log('Alerting about task now:', task)

                address = objectmodels['user'].find_one({'uuid': task.owner}).mail
                subject = "Task alert: %s" % task.name
                text = """Task alert is due:\n%s""" % task.notes

                self.fireEvent(send_mail(address, subject, text))

                alerted.append(task.alert_time)

        for item in alerted:
            del self.alerts[item]
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)
1069627
def up_by_arrival(*filters, local_dir=".", remote_dir=DEFAULT_REMOTE_DIR):
    """"""
    local_monitor = watch_local_files(*filters, local_dir=local_dir)
    _, file_set = next(local_monitor)
    _notify_sync_ready(len(file_set), local_dir, remote_dir)
    for new_arrivals, file_set in local_monitor:
        yield Direction.up, new_arrivals  # where new_arrivals is possibly empty
        if new_arrivals:
            _notify_sync(Direction.up, new_arrivals)
            up_by_files(new_arrivals, remote_dir)
            _notify_sync_ready(len(file_set), local_dir, remote_dir)
840002
def listen_for_updates(self):
        """"""
        self.toredis.subscribe(self.group_pubsub, callback=self.callback)
156660
def notify_block_new(self, block):
        """"""
        payload = block.SerializeToString()
        self._notify(
            "consensus_notifier_notify_block_new", payload, len(payload))
1363034
def alert_policy_exists(self, policy_name):
    """"""
    if next((policy for policy in self.all_alerts if policy['name'] == policy_name), False):
      return True
79825
def watch(self, limit=None, timeout=None):
        """"""
        start_time = time.time()
        count = 0
        while not timeout or time.time() - start_time < timeout:
            new = self.read()
            if new != self.temp:
                count += 1
                self.callback(new)
                if count == limit:
                    break
            self.temp = new
            time.sleep(self.interval)
648222
def is_notifying(cls, user_or_email, instance):
        """"""
        return super(InstanceEvent, cls).is_notifying(user_or_email,
                                                      object_id=instance.pk)
1320519
public void acceptAlert() {
        String action = "Clicking 'OK' on an alert";
        String expected = "Alert is present to be clicked";
        // wait for element to be present
        if (!is.alertPresent()) {
            waitFor.alertPresent();
        }
        if (!is.alertPresent()) {
            reporter.fail(action, expected, "Unable to click alert as it is not present");
            return; // indicates element not present
        }
        accept(action, expected, "alert");
    }
253053
def handle_notification(self, msgtype, method, args, kwargs):
        """"""
        self.dispatch.call(method, args, kwargs)
214121
def notify_all(self):
        """"""
        self.condition.acquire()
        # python 3.x
        try:
            self.condition.notify_all()
        except:
            self.condition.notifyAll()
        self.condition.release()
352646
def check_for_new(self):
        """"""
        free_slots = self.max_processes - len(self.processes)
        for item in range(free_slots):
            key = self.queue.next()
            if key is not None:
                self.spawn_new(key)
69709
function notify() {
    var args = arguments
    handlers.forEach(function(f){ f.apply(null, args) }) }
1223255
def _update_notification(self, message=None):
        """"""
        if message is None:
            message = ''
        message_label = self._parts['notification label']
        message_label.config(text=message)
        self._base.update()