actions:: Array of actions or single ActionTimer::Action
 Add single or multiple Actions to the timer at once
344917
def register(action)
      if(action.is_a?(Array))
        if(action.find{|x|x.is_a?(Action)}.nil?)
          raise ArgumentError.new('Array contains non ActionTimer::Action objects')
        end
      else
        raise ArgumentError.new('Expecting an ActionTimer::Action object') unless action.is_a?(Action)
        action = [action]
      end
      @add_lock.synchronize{ @new_actions = @new_actions + action }
      wakeup if running?
    end
1170013
function addActionHandler(path, actionMap, filePath) {

  const {init} = path.node;

  if (init && Array.isArray(init.properties)) {
    init.properties.forEach(property => {
      const {key, value} = property;
      if (key && value && key.property && value.property) {
        const actionType = key.property.name;
        const updater = value.name;

        actionMap[actionType] = actionMap[actionType] || createActionNode(actionType);
        actionMap[actionType].updaters.push({
          updater: value.object.name,
          name: value.property.name,
          path: filePath
        });
      }
    })
  }
}
727225
def addAction(self, action):
        
        self.ACTIONS.append(action)
        return "ACTION#{}".format(len(self.ACTIONS) - 1)
19356
def addAction(self, action, checked=None, autoBuild=True):
        
        # clear the holder
        actions = self._actionGroup.actions()
        if actions and actions[0].objectName() == 'place_holder':
            self._actionGroup.removeAction(actions[0])
            actions[0].deleteLater()
        
        # create an action from the name
        if not isinstance(action, QAction):
            action_name = nativestring(action)
            action = QAction(action_name, self)
            action.setObjectName(action_name)
            action.setCheckable(self.isCheckable())
            
            # auto-check the first option
            if checked or (not self._actionGroup.actions() and checked is None):
                action.setChecked(True)
        
        elif self.isCheckable():
            action.setCheckable(True)
            if not self.currentAction():
                action.setChecked(True)
        
        self._actionGroup.addAction(action)
        
        if autoBuild:
            self.rebuild()
        
        return action
1258757
def combine_action_handlers(*handlers):
    
    # make sure each of the given handlers is callable
    for handler in handlers:
        # if the handler is not a function
        if not (iscoroutinefunction(handler) or iscoroutine(handler)):
            # yell loudly
            raise ValueError("Provided handler is not a coroutine: %s" % handler)

    # the combined action handler
    async def combined_handler(*args, **kwds):
        # goes over every given handler
        for handler in handlers:
            # call the handler
            await handler(*args, **kwds)

    # return the combined action handler
    return combined_handler
978615
def init_actions
      am = action_manager()
      am.add_action(Action.new("&Disable selection") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )
      am.add_action(Action.new("&Edit Toggle") { @edit_toggle = !@edit_toggle; $status_message.value = "Edit toggle is #{@edit_toggle}" })
    end
352042
def handle_action
      timeline_item = find_timeline_item(self.glass_item_id)

      # TODO: Should we uniq these? When glass doesn't have connection, it will queue up
      # actions, so users might press the same one multiple times.
      user_actions.uniq.each do |user_action|
        type = user_action[:type] == "CUSTOM" ? user_action[:payload] : user_action[:type]
        json_to_return = self.reply_request_hash ? self.reply_request_hash : self.params
        timeline_item.send("handles_#{type.downcase}", json_to_return)
      end if user_actions
    end
728441
def add(hash, &func)
      raise ArgumentError.new('Expecting hash of arguments') unless hash.is_a?(Hash)
      raise ArgumentError.new('A period must be provided for timed action') unless hash[:period]
      raise ArgumentError.new('Block must be provided') unless block_given?
      raise ArgumentError.new('Block must accept data value') if hash[:data] && func.arity == 0
      args = {:once => false, :data => nil, :owner => nil}.merge(hash)
      action = Action.new(args.merge(:timer => self), &func)
      @add_lock.synchronize{ @new_actions << action }
      wakeup if running?
      action
    end
1028892
function schedule(actionName) {
      timeout.clear();
      var timeoutMS = timeout.timeoutMS(actionName);
      log.debug({ actionName: actionName, timeoutMS: timeoutMS }, 'schedule');
      var args = { actionName: actionName, isPaused: _isPauseTriggered(timeoutMS) };
      if (timeoutMS > 0) return setTimeout(function () {
        return execute(args);
      }, timeoutMS);
      execute(args);
    }
1354
def actions(*actions_to_keep)
        raise ArgumentError, 'Wrong number of arguments. You have to provide which actions you want to keep.' if actions_to_keep.empty?

        options = actions_to_keep.extract_options!
        actions_to_remove = Array(options[:except])
        actions_to_remove += ACTIONS - actions_to_keep.map { |a| a.to_sym } unless actions_to_keep.first == :all
        actions_to_remove.map! { |a| a.to_sym }.uniq!
        (instance_methods.map { |m| m.to_sym } & actions_to_remove).each do |action|
          undef_method action, "#{action}!"
        end
      end
912468
function(name, action, context) {
        if (!name || !action) {
            return;
        }
        var handlers = this.__handlers__ || (this.__handlers__={});
        if (!handlers[name]) {
            handlers[name] = [];
        }
        else {
            if (this.has(name, action)) {
                return;
            }
        }
        var handler = new Handler(action, context || this);
        handlers[name].push(handler);

        return this;
    }
618034
function ()
    {
        var i, thand, since, newList;

        // add timed handlers scheduled for addition
        // NOTE: we add before remove in the case a timed handler is
        // added and then deleted before the next _onIdle() call.
        while (this.addTimeds.length > 0) {
            this.timedHandlers.push(this.addTimeds.pop());
        }

        // remove timed handlers that have been scheduled for deletion
        while (this.removeTimeds.length > 0) {
            thand = this.removeTimeds.pop();
            i = this.timedHandlers.indexOf(thand);
            if (i >= 0) {
                this.timedHandlers.splice(i, 1);
            }
        }

        // call ready timed handlers
        var now = new Date().getTime();
        newList = [];
        for (i = 0; i < this.timedHandlers.length; i++) {
            thand = this.timedHandlers[i];
            if (this.authenticated || !thand.user) {
                since = thand.lastCalled + thand.period;
                if (since - now <= 0) {
                    if (thand.run()) {
                        newList.push(thand);
                    }
                } else {
                    newList.push(thand);
                }
            }
        }
        this.timedHandlers = newList;

        clearTimeout(this._idleTimeout);

        this._proto._onIdle();

        // reactivate the timer only if connected
        if (this.connected) {
            this._idleTimeout = setTimeout(this._onIdle.bind(this), 100);
        }
    }
317969
def add_recipe_actions(self, recipe_actions):
        
        for action_name, action in recipe_actions:
            self._recipe_actions[action_name] = action
1084683
def setup_common_actions(self):
        """"""
        # Filters
        filters_action = create_action(self, _("Edit filename filters..."),
                                       None, ima.icon('filter'),
                                       triggered=self.edit_filter)
        # Show all files
        all_action = create_action(self, _("Show all files"),
                                   toggled=self.toggle_all)
        all_action.setChecked(self.show_all)
        self.toggle_all(self.show_all)

        # Show all files
        single_click_to_open = create_action(
            self,
            _("Single click to open"),
            toggled=self.set_single_click_to_open,
        )
        single_click_to_open.setChecked(self.single_click_to_open)
        return [filters_action, all_action, single_click_to_open]
1098935
def setActions( self, actions ):
        
        self.uiActionTREE.blockSignals(True)
        self.uiActionTREE.setUpdatesEnabled(False)
        
        self.uiActionTREE.clear()
        for action in actions:
            self.uiActionTREE.addTopLevelItem(ActionItem(action))
        
        self.uiActionTREE.sortByColumn(0, Qt.AscendingOrder)
        self.uiActionTREE.blockSignals(False)
        self.uiActionTREE.setUpdatesEnabled(True)
828674
def actions(type=nil)
      actions = type ? self.class.actions[type] : self.class.actions.values.flatten
      actions.inject([]) do |actions, description|
        actions << description.compile(self) if match_options?(description.options)
        actions
      end
    end
1045187
def _push_actions(self):
        
        data = cherrypy.request.json
        with self.app.lock:
            self.app.add_actions(data['actions'], data['scheduler_instance_id'])