Returns a list of available triggers.
185202
def triggers(self):
        
        self._triggers, value = self.get_attr_set(self._triggers, 'trigger')
        return value
1213724
public static TriggerContext on(Trigger trigger) {
        List<Trigger> addedTriggers = new ArrayList<Trigger>();
        if (trigger != null) {
            addedTriggers.add(trigger);
        }
        return new TriggerContext(addedTriggers);
    }
944663
function triggerEvents (list, args, context) {
  var pass = true

  if (list) {
    var i = 0
    var l = list.length
    var a1 = args[0]
    var a2 = args[1]
    var a3 = args[2]
    // call is faster than apply, optimize less than 3 argu
    // http://blog.csdn.net/zhengyinhui100/article/details/7837127
    switch (args.length) {
      case 0: for (; i < l; i += 2) {pass = list[i].call(list[i + 1] || context) !== false && pass} break
      case 1: for (; i < l; i += 2) {pass = list[i].call(list[i + 1] || context, a1) !== false && pass} break
      case 2: for (; i < l; i += 2) {pass = list[i].call(list[i + 1] || context, a1, a2) !== false && pass} break
      case 3: for (; i < l; i += 2) {pass = list[i].call(list[i + 1] || context, a1, a2, a3) !== false && pass} break
      default: for (; i < l; i += 2) {pass = list[i].apply(list[i + 1] || context, args) !== false && pass} break
    }
  }
  // trigger will return false if one of the callbacks return false
  return pass
}
960294
def get(self, sid):
        
        return TriggerContext(self._version, account_sid=self._solution['account_sid'], sid=sid, )
946679
def _getAllEvents(self, request):
        """"""
        home = request.site.root_page
        return getAllEvents(request, home=home)
1148899
def trigger(self, event: str, *args: T.Any, **kw: T.Any) -> bool:
        """"""

        callbacks = list(self._events.get(event, []))
        if not callbacks:
            return False

        for callback in callbacks:
            callback(*args, **kw)
        return True
60153
def _process_binary_trigger(trigger_value, condition):
    """"""

    ops = {
        0: ">",
        1: "<",
        2: ">=",
        3: "<=",
        4: "==",
        5: 'always'
    }

    sources = {
        0: 'value',
        1: 'count'
    }

    encoded_source = condition & 0b1
    encoded_op = condition >> 1

    oper = ops.get(encoded_op, None)
    source = sources.get(encoded_source, None)

    if oper is None:
        raise ArgumentError("Unknown operation in binary trigger", condition=condition, operation=encoded_op, known_ops=ops)
    if source is None:
        raise ArgumentError("Unknown value source in binary trigger", source=source, known_sources=sources)

    if oper == 'always':
        return TrueTrigger()

    return InputTrigger(source, oper, trigger_value)
657090
def trigger(self_, *param_names):
        
        events = self_.self_or_cls.param._events
        watchers = self_.self_or_cls.param._watchers
        self_.self_or_cls.param._events  = []
        self_.self_or_cls.param._watchers = []
        param_values = dict(self_.get_param_values())
        params = {name: param_values[name] for name in param_names}
        self_.self_or_cls.param._TRIGGER = True
        self_.set_param(**params)
        self_.self_or_cls.param._TRIGGER = False
        self_.self_or_cls.param._events = events
        self_.self_or_cls.param._watchers = watchers
819834
public List<OperableTrigger> getTriggersForJob(JobKey jobKey, T jedis) throws JobPersistenceException {
        final String jobTriggerSetKey = redisSchema.jobTriggersSetKey(jobKey);
        final Set<String> triggerHashKeys = jedis.smembers(jobTriggerSetKey);
        List<OperableTrigger> triggers = new ArrayList<>();
        for (String triggerHashKey : triggerHashKeys) {
            triggers.add(retrieveTrigger(redisSchema.triggerKey(triggerHashKey), jedis));
        }
        return  triggers;
    }
907718
def get_hacr_triggers(channel, start, end, columns=HACR_COLUMNS, pid=None,
                      monitor='chacr', selection=None, **connectkwargs):
    
    if columns is None:
        columns = HACR_COLUMNS
    columns = list(columns)
    span = Segment(*map(to_gps, (start, end)))

    # parse selection for SQL query (removing leading 'where ')
    selectionstr = 'and %s' % format_db_selection(selection, engine=None)[6:]

    # get database names and loop over each on
    databases = get_database_names(start, end)
    rows = []
    for db in databases:
        conn = connect(db, **connectkwargs)
        cursor = conn.cursor()
        # find process ID(s) for this channel
        pids = query("select process_id, gps_start, gps_stop "
                     "from job where monitorName = %r and channel = %r"
                     % (monitor, str(channel)), connection=conn)
        for p, s, e in pids:
            # validate this process id
            if pid is not None and int(p) != int(pid):
                continue
            tspan = Segment(float(s), float(e))
            if not tspan.intersects(span):
                continue
            # execute trigger query
            q = ('select %s from mhacr where process_id = %d and '
                 'gps_start > %s and gps_start < %d %s order by gps_start asc'
                 % (', '.join(columns), int(p), span[0], span[1],
                    selectionstr))
            n = cursor.execute(q)
            if n == 0:
                continue
            # get new events, convert to recarray, and append to table
            rows.extend(cursor.fetchall())
    return EventTable(rows=rows, names=columns)
1331719
boolean canTrigger(Table table, boolean[] columnCheckList) {

        if (isFull || isFullTrigger) {
            return true;
        }

        return containsAllColumns(triggerColumnSet, table, columnCheckList);
    }
306056
def get_events(self):
        
        res = copy.copy(self.events)
        del self.events[:]
        return res
457166
def get_all_handlers(self) -> T.Dict[str, T.List[T.Callable]]:
        """"""

        events = {}
        for event, handlers in self._events.items():
            events[event] = list(handlers)
        return events
472320
function triggerIfHandlers(that, handlerListName, event) {
    triggerIfHandlerList(that[handlerListName][event], event)
    triggerIfHandlerList(that[normalHandlerToAllHandlerProperty(handlerListName)], event)
}
463658
@Override
  public List<TriggerFiredResult> triggersFired(List<OperableTrigger> triggers) {

    synchronized (lock) {
      List<TriggerFiredResult> results = new ArrayList<TriggerFiredResult>();

      for (OperableTrigger trigger : triggers) {
        TriggerWrapper tw = wrappedTriggersByKey.get(trigger.getName());
        // was the trigger deleted since being acquired?
        if (tw == null || tw.trigger == null) {
          continue;
        }
        // was the trigger completed, paused, blocked, etc. since being acquired?
        if (tw.state != TriggerWrapper.STATE_ACQUIRED) {
          continue;
        }

        Calendar cal = null;
        if (tw.trigger.getCalendarName() != null) {
          cal = retrieveCalendar(tw.trigger.getCalendarName());
          if (cal == null) {
            continue;
          }
        }
        Date prevFireTime = trigger.getPreviousFireTime();
        // in case trigger was replaced between acquiring and firing
        timeWrappedTriggers.remove(tw);
        // call triggered on our copy, and the scheduler's copy
        tw.trigger.triggered(cal);
        trigger.triggered(cal);
        // tw.state = TriggerWrapper.STATE_EXECUTING;
        tw.state = TriggerWrapper.STATE_WAITING;

        TriggerFiredBundle bndle =
            new TriggerFiredBundle(
                retrieveJob(tw.jobKey),
                trigger,
                cal,
                false,
                new Date(),
                trigger.getPreviousFireTime(),
                prevFireTime,
                trigger.getNextFireTime());

        JobDetail job = bndle.getJobDetail();

        if (!job.isConcurrencyAllowed()) {
          ArrayList<TriggerWrapper> trigs = getTriggerWrappersForJob(job.getName());
          Iterator<TriggerWrapper> itr = trigs.iterator();
          while (itr.hasNext()) {
            TriggerWrapper ttw = itr.next();
            if (ttw.state == TriggerWrapper.STATE_WAITING) {
              ttw.state = TriggerWrapper.STATE_BLOCKED;
            }
            if (ttw.state == TriggerWrapper.STATE_PAUSED) {
              ttw.state = TriggerWrapper.STATE_PAUSED_BLOCKED;
            }
            timeWrappedTriggers.remove(ttw);
          }
          blockedJobs.add(job.getName());
        } else if (tw.trigger.getNextFireTime() != null) {
          synchronized (lock) {
            timeWrappedTriggers.add(tw);
          }
        }

        results.add(new TriggerFiredResult(bndle));
      }
      return results;
    }
  }
528112
def get_alerts_for(self, trigger):
        
        assert trigger is not None
        assert isinstance(trigger.id, str), "Value must be a string"
        status, data = self.http_client.get_json(
            ALERTS_URI % trigger.id,
            params={'appid': self.API_key},
            headers={'Content-Type': 'application/json'})
        return [self.alert_parser.parse_dict(item) for item in data]
272088
protected function getTriggersPriceRule()
    {
        $list = (array) $this->trigger->getList();

        foreach ($list as &$item) {
            if (empty($item['status'])) {
                $item['name'] .= ' (' . $this->lower($this->text('Disabled')) . ')';
            }
        }

        return $list;
    }