run actions : restore , delete , trash
777084
public function runActions ()
    {
        $action = \request()->input('action');
        $selection = \request()->input('selection');

        if ($action == '' || $selection == null)
            throw new CategoryException(trans('Categories::category.error-message.sendDataError'));

        switch ($action) {
            case "delete":
                $this->category->whereIn('id' , $selection)->forceDelete();
                break;
            case "restore":
                $this->category->whereIn('id' , $selection)->restore();
                break;
            case "destroy":
                $this->category->whereIn('id' , $selection)->delete();
                break;
        }
    }
1119541
function updateActions() {
        this.plugin('done', function () {
          var cmd;
          if (envOptions['update-actions']) {
            // Don't disable actions since this is mostly for development.
            cmd = 'python manage.py update_actions';

            childProcess.exec(cmd, function (err, stdout, stderr) {
              console.log('\n' + BOLD + 'Updating Actions' + END_BOLD);
              console.log(stdout);
              if (stderr) {
                console.error(stderr);
              }
            });
          }
        });
      }
881406
def execute
      return Strings.no_help_commands if @actions.empty?
      actions = @actions.map do |action|
        if action.description.to_s.empty?
          action.name
        else
          "#{action.name} # #{action.description}"
        end
      end
      Strings.help(actions.join("\n"))
    end
991474
def run(self):
        ""
        self.addServices()
        self.catalogServers(self.hendrix)
        action = self.action
        fd = self.options['fd']

        if action.startswith('start'):
            chalk.blue(self._listening_message())
            getattr(self, action)(fd)

            ###########################
            # annnnd run the reactor! #
            ###########################
            try:
                self.reactor.run()
            finally:
                shutil.rmtree(PID_DIR, ignore_errors=True)  # cleanup tmp PID dir

        elif action == 'restart':
            getattr(self, action)(fd=fd)
        else:
            getattr(self, action)()
411846
void doFlush()
    {
        enableFlush = true;
        flush();
        execute();
        enableFlush = false;
        flushManager.commit();
        flushManager.clearFlushStack();
    }
366718
def on_ok(self):
        
        if self.dir_select.value:
            npyscreen.notify_wait('In the process of restoring',
                                  title='Restoring...')
            status = self.restore(self.dirs[self.dir_select.value[0]])
            if status[0]:
                npyscreen.notify_confirm('Status of restore:\n' +
                                         status[1])
            else:
                npyscreen.notify_confirm(status[1])
            self.quit()
        else:
            npyscreen.notify_confirm('Choose a version to restore from')
829161
public function actionClear()
    {
        OAuth2AuthorizationCode::deleteAll(['<', 'expires', time()]);
        OAuth2RefreshToken::deleteAll(['<', 'expires', time()]);
        OAuth2AccessToken::deleteAll(['<', 'expires', time()]);
    }
899785
def run(self, command, opts):
        """"""
        handlers = { 
            'create': self.create,
            'delete': self.delete,
            'list': self.list
        }
        handler = handlers.get(command, None)
        if handler is None:
            error("Unrecognized command: %s" % command, 2)
        handler(opts)
822218
function trashOrUntrashPages(cb) {
          const ids = tree.map(p => p._id);
          return self.apos.docs.db.update({ _id: { $in: ids } }, action, {
            multi: true
          }, (err, res) => {
            cb(err);
          });
        }
897837
def clean():
    """"""
    run('rm -rf build/')
    run('rm -rf dist/')
    run('rm -rf puzzle.egg-info')
    run('find . -name __pycache__ -delete')
    run('find . -name *.pyc -delete')
    run('find . -name *.pyo -delete')
    run('find . -name *~ -delete')

    log.info('cleaned up')
948323
def cleanup_state
      # intentionally not deleting entire temp dir to preserve localized
      # executable directories between tests on Windows. see how we reference
      # RS_RIGHT_RUN_EXE below.
      delete_if_exists(state_file_path)
      delete_if_exists(chef_file_path)
      delete_if_exists(past_scripts_path)
      delete_if_exists(log_path)
      delete_if_exists(cook_state_file_path)
    end
207721
def run(self):
        '''
        
        '''
        self._update_opts()
        cmd = self.opts['fun']

        veri = None
        ret = None
        try:
            if cmd in ('accept', 'reject', 'delete'):
                ret = self._run_cmd('name_match')
                if not isinstance(ret, dict):
                    salt.output.display_output(ret, 'key', opts=self.opts)
                    return ret
                ret = self._filter_ret(cmd, ret)
                if not ret:
                    self._print_no_match(cmd, self.opts['match'])
                    return
                print('The following keys are going to be {0}ed:'.format(cmd.rstrip('e')))
                salt.output.display_output(ret, 'key', opts=self.opts)

                if not self.opts.get('yes', False):
                    try:
                        if cmd.startswith('delete'):
                            veri = input('Proceed? [N/y] ')
                            if not veri:
                                veri = 'n'
                        else:
                            veri = input('Proceed? [n/Y] ')
                            if not veri:
                                veri = 'y'
                    except KeyboardInterrupt:
                        raise SystemExit("\nExiting on CTRL-c")
                # accept/reject/delete the same keys we're printed to the user
                self.opts['match_dict'] = ret
                self.opts.pop('match', None)
                list_ret = ret

            if veri is None or veri.lower().startswith('y'):
                ret = self._run_cmd(cmd)
                if cmd in ('accept', 'reject', 'delete'):
                    if cmd == 'delete':
                        ret = list_ret
                    for minions in ret.values():
                        for minion in minions:
                            print('Key for minion {0} {1}ed.'.format(minion,
                                                                     cmd.rstrip('e')))
                elif isinstance(ret, dict):
                    salt.output.display_output(ret, 'key', opts=self.opts)
                else:
                    salt.output.display_output({'return': ret}, 'key', opts=self.opts)
        except salt.exceptions.SaltException as exc:
            ret = '{0}'.format(exc)
            if not self.opts.get('quiet', False):
                salt.output.display_output(ret, 'nested', self.opts)
        return ret
962896
def rollback():
    

    init_tasks()

    run_hook("before_rollback")

    # Remove current version
    current_release = paths.get_current_release_path()
    if current_release:
        env.run("rm -rf %s" % current_release)

    # Restore previous version
    old_release = paths.get_current_release_name()
    if old_release:
        paths.symlink(paths.get_source_path(old_release),
                      paths.get_current_path())

    run_hook("rollback")
    run_hook("after_rollback")

    logger.info("Rollback complete")
883453
def run(self, name, *args):
        """"""
        assert isinstance(name, string_types)
        # Resolve the alias if it is an alias.
        name = self._aliases.get(name, name)
        # Get the action.
        action = self._actions_dict.get(name, None)
        if not action:
            raise ValueError("Action `{}` doesn't exist.".format(name))
        if not name.startswith('_'):
            logger.debug("Execute action `%s`.", name)
        return action.callback(*args)
948269
def run_on_removals(paths)
      return unless options[:delete]
      validate_at_least_one_target('delete')
      with_all_target_paths(paths) do |_, to_path|
        validate_to_file(to_path)
        UI.info("deleting #{to_path}") if options[:verbose]
        FileUtils.rm(to_path)
      end
    end
664675
def _perform_database_action(action, *args):
    
    session = _get_session()
    getattr(session, action)(*args)
    session.commit()
360618
def cleanup():
        """"""
        for install_dir in linters.INSTALL_DIRS:
            try:
                shutil.rmtree(install_dir, ignore_errors=True)
            except Exception:
                print(
                    "{0}\nFailed to delete {1}".format(
                        traceback.format_exc(), install_dir
                    )
                )
                sys.stdout.flush()