Trigger check when main character or state changes.
766036
def check_groups_on_profile_update(sender, instance, created, *args, **kwargs):
    
    AutogroupsConfig.objects.update_groups_for_user(instance.user)
680046
private State checkL(State state) throws DatatypeException, IOException {
        if (state.context.length() == 0) {
            state = appendToContext(state);
        }
        state.current = state.reader.read();
        state = appendToContext(state);
        state = skipSpaces(state);
        _checkL('L', true, state);
        return state;
    }
443063
function helper_updateRuleState(triggerIdentifier, ruleIdentifier, state)
{
	exec(null,
		null,
		'EstimoteBeacons',
		'triggers_updateRuleState',
		[triggerIdentifier, ruleIdentifier, state]
	);
}
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)
350633
@Override
	public void changeTriggerState(String groupName, String jobName, final String triggerGroup, final String triggerName) throws SchedulerException {
		if (!config.isChangetTriggerStateAllowed()) {
			LOGGER.warn("not allowed to change any trigger state");
			return;
		}
		Trigger triggerFound = findTrigger(groupName, jobName, triggerGroup, triggerName);
		
		if (null != triggerFound) {
			// pause only the one trigger of job
			changeTriggerState(triggerFound);
			if (LOGGER.isDebugEnabled())
				LOGGER.debug(String.format("pausing trigger for group: %s, job: %s, trigger: %s ", groupName, jobName,
						triggerName));
		} else {
			if (LOGGER.isDebugEnabled())
				LOGGER.debug(String.format("pausing all triggers for group: %s, job: %s", groupName, jobName));
			List<? extends Trigger> triggers = scheduler.getTriggersOfJob(new JobKey(jobName, groupName));
			for (Trigger trigger : triggers) {
				// pause all triggers of job
				changeTriggerState(trigger);
			}
		}
	}
553668
def _pre_transition_checks(self):
        """"""
        current_state = getattr(self.instance, self.field_name)
        if current_state not in self.transition.source:
            raise InvalidTransitionError(
                "Transition '%s' isn't available from state '%s'." %
                (self.transition.name, current_state.name))

        for check in self._filter_hooks(HOOK_CHECK):
            if not check(self.instance):
                raise ForbiddenTransition(
                    "Transition '%s' was forbidden by "
                    "custom pre-transition check." % self.transition.name)
668856
def _on_changed(self):
        """"""
        page = self._get_page()
        if not page.flag_autosave:
            page.flag_changed = True
            self._update_gui_text_tabs()
800561
function onBeforeShow() {
    var trigger = self.hc_.getAnchorElement();
    var ch = self.getChar_(trigger);
    if (ch) {
      goog.dom.setTextContent(self.zoomEl_, self.displayChar_(ch));
      goog.dom.setTextContent(self.unicodeEl_, goog.i18n.uChar.toHexString(ch));
      // Clear the character name since we don't want to show old data because
      // it is retrieved asynchronously and the DOM object is re-used
      goog.dom.setTextContent(self.charNameEl_, '');
      self.charNameFetcher_.getName(ch, function(charName) {
        if (charName) {
          goog.dom.setTextContent(self.charNameEl_, charName);
        }
      });
    }
  }
630721
function onBeforeShow() {
    var trigger = self.hc_.getAnchorElement();
    var ch = self.getChar_(trigger);
    if (ch) {
      self.zoomEl_.innerHTML = self.displayChar_(ch);
      self.unicodeEl_.innerHTML = goog.i18n.uChar.toHexString(ch);
      // Clear the character name since we don't want to show old data because
      // it is retrieved asynchronously and the DOM object is re-used
      self.charNameEl_.innerHTML = '';
      self.charNameFetcher_.getName(ch, function(charName) {
        if (charName) {
          self.charNameEl_.innerHTML = charName;
        }
      });
    }
  }
208224
function (state) {
		var changed = false;

		switch(state){
		case false:
			changed = ( this.selected || this.partsel );
			this.selected = false;
			this.partsel = false;
			break;
		case true:
			changed = ( !this.selected || !this.partsel );
			this.selected = true;
			this.partsel = true;
			break;
		case undefined:
			changed = ( this.selected || !this.partsel );
			this.selected = false;
			this.partsel = true;
			break;
		default:
			_assert(false, "invalid state: " + state);
		}
		// this.debug("fixSelection3AfterLoad() _changeSelectStatusAttrs()", state, changed);
		if( changed ){
			this.renderStatus();
		}
		return changed;
	}
703121
def OnTableChanged(self, event):
        """"""

        if hasattr(event, 'table'):
            self.Select(event.table)
            self.EnsureVisible(event.table)

        event.Skip()
673634
def _isValidTrigger(block, ch):
        
        if ch == "" or ch == "\n":
            return True # Explicit align or new line

        match = rxUnindent.match(block.text())
        return match is not None and \
               match.group(3) == ""
610159
async def _run_state(self, responder, state, trigger, request) \
            -> BaseState:
        

        user_trigger = trigger

        # noinspection PyBroadException
        try:
            if trigger:
                await state.handle()
            else:
                await state.confused()

            for i in range(0, settings.MAX_INTERNAL_JUMPS + 1):
                if i == settings.MAX_INTERNAL_JUMPS:
                    raise MaxInternalJump()

                trigger, state_class, dnr = \
                    await self._find_trigger(request, state.name(), True)

                if not trigger:
                    break

                logger.debug('Jumping to state: %s', state_class.name())
                state = state_class(request, responder, trigger, user_trigger)
                await state.handle()
        except Exception:
            logger.exception('Error while handling state "%s"', state.name())
            responder.clear()
            reporter.report(request, state.name())
            await state.error()

        return state
132711
@Override
    public void onTextChanged(CharSequence s, int start, int before, int count) {

        if (findFocus() != null) {
            currentFocus = Integer.parseInt(findFocus().getTag().toString());
        }

        if (count == 1 && s.length() == mNumberCharacters) {
            if (currentFocus == (mNumberPinBoxes - 1) || currentFocus == 0) {
                checkPinBoxesAvailableOrder();
            } else {
                checkPinBoxesAvailable();
            }

        }
    }
1165860
def _trigger_refresh(self, key):
        ""
        if self.top_level:
            self.update(key)
        else:
            self.current_key = None
            self.current_frame = None
1047804
def _wait_trigger(self):
        """"""
        if _debug: IOQController._debug("_wait_trigger")

        # make sure we are waiting
        if (self.state != CTRL_WAITING):
            raise RuntimeError("not waiting")

        # change our state
        self.state = CTRL_IDLE
        _statelog.debug("%s %s %s" % (_strftime(), self.name, "idle"))

        # look for more to do
        IOQController._trigger(self)
1092321
def check(self):
        """"""
        has_term = False

        if self.START_STATE not in self.states:
            raise SyntaxError('Undefined start rule')

        for state in self.states:
            for rule in self.states[state]:
                if rule is not None:
                    if rule[2] == self.TERM_STATE:
                        has_term = True
                    elif rule[2] not in self.states:
                        raise SyntaxError('Unexpected state: ' + rule[2])

        if not has_term:
            raise SyntaxError('Missed terminate state')