Add an option/flag to the next action (can be called multiple
 times)
   option '-b --background', 'Start in the background'
195187
def option(flag, text, scope=nil)
      Runner.instance.add_option flag, text, scope
    end
576308
def handle_option(self, opt):
        """"""
        self.options.append(opt)
        log.debug('options: %s', self.options)
581253
def option(flag)
      options.find do |o|
        o.flags.any? { |f| clean_key(f) == clean_key(flag) }
      end
    end
1026090
def bind
      Spinach.hooks.tap do |hooks|
        hooks.before_run { |*args| before_run(*args) }
        hooks.after_run { |*args| after_run(*args) }
        hooks.before_feature { |*args| before_feature_run(*args) }
        hooks.after_feature { |*args| after_feature_run(*args) }
        hooks.on_undefined_feature { |*args| on_feature_not_found(*args) }
        hooks.before_scenario { |*args| before_scenario_run(*args) }
        hooks.around_scenario { |*args, &block| around_scenario_run(*args, &block) }
        hooks.after_scenario { |*args| after_scenario_run(*args) }
        hooks.on_successful_step { |*args| on_successful_step(*args) }
        hooks.on_undefined_step { |*args| on_undefined_step(*args) }
        hooks.on_pending_step { |*args| on_pending_step(*args) }
        hooks.on_failed_step { |*args| on_failed_step(*args) }
        hooks.on_error_step { |*args| on_error_step(*args) }
        hooks.on_skipped_step { |*args| on_skipped_step(*args) }

        hooks.before_feature { |*args| set_current_feature(*args) }
        hooks.after_feature { |*args| clear_current_feature(*args) }
        hooks.before_scenario { |*args| set_current_scenario(args.first) }
        hooks.after_scenario { |*args| clear_current_scenario(args.first) }
      end
    end
491310
@Action(
            semantics = SemanticsOf.IDEMPOTENT,
            command = CommandReification.ENABLED
    )
    @ActionLayout(
            describedAs = "invoke from UI, will change the name in the background using a direct action, background.execute(...).changeName(...)"
    )
    public SomeCommandAnnotatedObject changeNameExplicitlyInBackgroundUsingDirectAction(
            @ParameterLayout(named = "New name")
            final String newName) {
        backgroundService.execute(this).changeName(newName);
        return this;
    }
1055540
def add_action_callback(self, key_value, modifier_mask, a_dict=False):
        """"""
        if react_to_event(self.view, self.tree_view, event=(key_value, modifier_mask)) and self.active_entry_widget is None:
            self.on_add(None, a_dict)
            return True
564503
function(type, action, name, opts, emitter) {
  logger.info('Running: ' + name)
  running[name] = action;

  emitter.once('end', function(err, out) {
    if (err) hooks.trigger('error', err);

    logger.info('Stopped: ' + name);
    action_stopped(name);

    setTimeout(function() {
      hooks.trigger(type, 'stopped', name, opts, err, out);
    }, 1000);

    if (action.events)
      emitter.removeAllListeners();
  })

  if (!action.events) return;
  watch_action_events(action.events, emitter);
}
886772
public function runInBackgroundCommand(): void
    {
        $script = '<?php print_r($_SERVER); ?>';
        $ret = Sys::execInBackground("php $script");

        if ($ret === false) {
            $this->output->liteError('current env is not support process create.');
        }
    }
753741
def list_flag_option(name, description, **config)
      add_option Clin::OptionList.new(name, description, **config.merge(argument: false))
    end
1073900
def add_arguments(self, actions):
        
        actions = sorted(
            actions, key=operator.attrgetter('option_strings'))
        super(SortedHelpFormatter, self).add_arguments(actions)
1335783
function(event, action) {
        var data = window.kelmu.data[id];
        var stepsLeft = Math.max(+(action.parameter || 1), 1);
        var stepsToRun = 0;

        var proceed = function() {
          this('skip', stepsToRun);
        };

        while (stepsLeft > 0) {

          var subSteps = (data.definitions['step' + data.stepNumber] || [null]).length - 1;
          var currentSub = data.subStepNumber;
          var canIncrease = subSteps - currentSub;

          if (canIncrease < stepsLeft) {

            data.stepNumber += 1;
            data.subStepNumber = 0;
            stepsToRun += 1;
            stepsLeft -= canIncrease + 1;

          } else if (canIncrease > 0) {

            if (stepsToRun > 0) {
              $.each(window.kelmu.callbacks[id], proceed);
              stepsToRun = 0;
              clearAnnotations();
              originalStep(event);
            }

            stepsLeft -= canIncrease;
            data.subStepNumber = data.subStepNumber + canIncrease;
          } else {
            data.stepNumber += 1;
            stepsToRun += 1;
            stepsLeft -= 1;
          }

        }

        if (stepsToRun > 0) {
          $.each(window.kelmu.callbacks[id], proceed);
          stepsToRun = 0;
          clearAnnotations();
          originalStep(event);

          if (!window.kelmu.data[id].animationReadyAvailable) {
            setTimeout(function() {
              createAnnotations();
              if (window.kelmu.data[id].actions.updateEditor) {
                window.kelmu.data[id].actions.updateEditor();
              }
            }, window.kelmu.data[id].settings.animationLength);
          }

        } else {
          createAnnotations();
        }

        window.kelmu.data[id].undoStack.splice(window.kelmu.data[id].undoStackPointer + 1, window.kelmu.data[id].undoStack.length);
        window.kelmu.data[id].undoStack.push([window.kelmu.data[id].stepNumber, window.kelmu.data[id].subStepNumber]);
        window.kelmu.data[id].undoStackPointer += 1;

      }
1087762
def console_set_background_flag(con: tcod.console.Console, flag: int) -> None:
    
    lib.TCOD_console_set_background_flag(_console(con), flag)
951006
def setCurrentAction(self, action):
        
        if action == self._currentAction:
            return
        
        self._currentAction = action
        self.currentActionChanged.emit(action)
        
        labels   = self.actionLabels()
        anim_grp = QParallelAnimationGroup(self)
        max_size = self.maximumPixmapSize()
        min_size = self.minimumPixmapSize()
        
        if action:
            label = self.labelForAction(action)
            index = labels.index(label)
            
            # create the highlight effect
            palette = self.palette()
            effect = QGraphicsDropShadowEffect(label)
            effect.setXOffset(0)
            effect.setYOffset(0)
            effect.setBlurRadius(20)
            effect.setColor(QColor(40, 40, 40))
            label.setGraphicsEffect(effect)
            
            offset = self.padding()
            if self.position() in (XDockToolbar.Position.East,
                                   XDockToolbar.Position.West):
                self.resize(max_size.width() + offset, self.height())
            
            elif self.position() in (XDockToolbar.Position.North,
                                     XDockToolbar.Position.South):
                self.resize(self.width(), max_size.height() + offset)
            
            w  = max_size.width()
            h  = max_size.height()
            dw = (max_size.width() - min_size.width()) / 3
            dh = (max_size.height() - min_size.height()) / 3
            
            for i in range(4):
                before = index - i
                after  = index + i
                
                if 0 <= before and before < len(labels):
                    anim = XObjectAnimation(labels[before],
                                            'setPixmapSize',
                                            anim_grp)
                    
                    anim.setEasingCurve(self.easingCurve())
                    anim.setStartValue(labels[before].pixmapSize())
                    anim.setEndValue(QSize(w, h))
                    anim.setDuration(self.duration())
                    anim_grp.addAnimation(anim)
                    
                    if i:
                        labels[before].setGraphicsEffect(None)
                
                if after != before and 0 <= after and after < len(labels):
                    anim = XObjectAnimation(labels[after],
                                            'setPixmapSize',
                                            anim_grp)
                    
                    anim.setEasingCurve(self.easingCurve())
                    anim.setStartValue(labels[after].pixmapSize())
                    anim.setEndValue(QSize(w, h))
                    anim.setDuration(self.duration())
                    anim_grp.addAnimation(anim)
                    
                    if i:
                        labels[after].setGraphicsEffect(None)
            
                w -= dw
                h -= dh
        else:
            offset = self.padding()
            for label in self.actionLabels():
                # clear the graphics effect 
                label.setGraphicsEffect(None)
                
                # create the animation
                anim = XObjectAnimation(label, 'setPixmapSize', self)
                anim.setEasingCurve(self.easingCurve())
                anim.setStartValue(label.pixmapSize())
                anim.setEndValue(min_size)
                anim.setDuration(self.duration())
                anim_grp.addAnimation(anim)
            
            anim_grp.finished.connect(self.resizeToMinimum)
        
        anim_grp.start()
        self._animating = True
        anim_grp.finished.connect(anim_grp.deleteLater)
        anim_grp.finished.connect(self.__markAnimatingFinished)
        
        if self._currentAction:
            self._hoverTimer.start()
        else:
            self._hoverTimer.stop()
1320670
function(next, options){
		var self = this;
		options = options || {};
		_.defaults(options, {
		// options = {
			outClass: 'pt-page-moveToLeft',
			inClass: 'pt-page-moveFromRight',

			force: false,
		});

		if(options.animation)
			_.extend(options, options.animation);

		// If we still animating, but not forcing, cancel change.
		if( this.isAnimating && !options.force)
			return false;
		this.isAnimating = true;
		
		var $currPage = this.$currentView;
		var $nextPage = (next ? this.saveView(next).addClass( 'pt-page-current' ) : null);

		if(!this.supportAnimation)
			return self.setPage($nextPage);

		this.trigger('start-animate');
		if($currPage){
			$currPage.addClass( options.outClass ).on( self.animEndEventName, function() {
				$currPage.off( self.animEndEventName );
				self.endCurrPage = true;
				checkEndAnimation();
			});
		}else{
			self.endCurrPage = true;
			checkEndAnimation();
		}

		if($nextPage){
			$nextPage.addClass( options.inClass ).on( self.animEndEventName, function() {
				$nextPage.off( self.animEndEventName );
				self.endNextPage = true;
				checkEndAnimation();
			} );
		}else{
			self.endNextPage = true;
			checkEndAnimation();
		}

		function checkEndAnimation(){
			if(self.endNextPage && self.endCurrPage)
				self.setPage($nextPage);
		}
	}
911657
function( option ) {
            if ( this._self === option.exporter ) {
                return;
            }

            if ( this._action && !this._action.test( option.action ) ) {
                return;
            }

            if ( this._path && !this._path.test( option.path ) ) {
                return;
            }

            if ( this._notePath || this._noteAction ) {

                if ( !(option instanceof EventPicker) || option.Test( this ) ) {
                    return;
                }

            }

            utilTick( this._self, this._listen, option, this._async );
        }
1072801
def run_foreground(self, *args, **kwargs):
        
        return self.run_via_binary(foreground=True, default_options=[], *args, **kwargs)
862556
def _add_action(self, action):
        
        kwargs = self._get_method_params()

        kwargs['action'] = action

        self._bulk_actions.append(kwargs)