Iterates over all the CRON_CLASSES (or if passed in as a commandline argument)
        and runs them.
436560
def handle(self, *args, **options):
        
        cron_classes = options['cron_classes']
        if cron_classes:
            cron_class_names = cron_classes
        else:
            cron_class_names = getattr(settings, 'CRON_CLASSES', [])

        try:
            crons_to_run = [get_class(x) for x in cron_class_names]
        except Exception:
            error = traceback.format_exc()
            self.stdout.write('Make sure these are valid cron class names: %s\n%s' % (cron_class_names, error))
            return

        for cron_class in crons_to_run:
            run_cron_with_cache_check(
                cron_class,
                force=options['force'],
                silent=options['silent']
            )

        clear_old_log_entries()
        close_old_connections()
432825
def run(self, **kwargs):
        
        for key in kwargs:
            setattr(self, key, kwargs[key])
        self.command = self.COMMAND_RUN
882226
protected function cron_execute() {

        try {
            $this->restore_response();
            $previous = $this->recentresponse;
            $this->fetch();
            $this->restore_response(true);
            $current = $this->recentresponse;
            $changes = $this->compare_responses($previous, $current);
            $notifications = $this->cron_notifications($changes);
            $this->cron_notify($notifications);
            $this->cron_mtrace('done');
        } catch (checker_exception $e) {
            $this->cron_mtrace('FAILED!');
        }
    }
960740
def run(self):
        """"""
        if self.auto_clear:
            os.system('cls' if os.name == 'nt' else 'auto_clear')
        else:
            print
        print 'Running unit tests...'
        if self.auto_clear:
            print
        subprocess.call('nosetests', cwd=self.directory)
1197390
public static function run(): void
    {
        foreach (self::COMMANDS as $name => $callable) {
            WP_CLI::add_command($name, $callable);
        }

        foreach (self::CHECKERS as $checker) {
            WP_CLI::add_wp_hook(CheckerCollectionFactory::REGISTER_HOOK, [$checker, 'register']);
        }

        // Register .toml config files.
        WP_CLI::add_wp_hook(ConfigPaths::HOOK, [ConfigPaths::class, 'mergeDefaultPath'], -50000);
        WP_CLI::add_wp_hook(ConfigPaths::HOOK, [ConfigPaths::class, 'mergeAbsPath'], 40000);
        WP_CLI::add_wp_hook(ConfigPaths::HOOK, [ConfigPaths::class, 'mergePreflightDir'], 50000);
    }
890124
def RunOnce(self):
    """"""
    # Start the cron thread if configured to.
    if config.CONFIG["Cron.active"]:

      self.cron_worker = CronWorker()
      self.cron_worker.RunAsync()
10268
def RunOnce(self, token=None, force=False, names=None):
    
    names = names or self.ListJobs(token=token)
    urns = [self.CRON_JOBS_PATH.Add(name) for name in names]

    for cron_job_urn in urns:
      try:
        with aff4.FACTORY.OpenWithLock(
            cron_job_urn, blocking=False, token=token,
            lease_time=600) as cron_job:
          try:
            logging.info("Running cron job: %s", cron_job.urn)
            cron_job.Run(force=force)
          except Exception as e:  # pylint: disable=broad-except
            logging.exception("Error processing cron job %s: %s", cron_job.urn,
                              e)
            stats_collector_instance.Get().IncrementCounter(
                "cron_internal_error")

      except aff4.LockError:
        pass
427500
def _run_queued_callbacks(self):
        '''  '''
        for callback in self._queued_callbacks:
            try:
                callback()
            except Exception as ex:
                logger.error("Exception: %s" % str(ex))
719597
public function main() {
		$this->out(__d('cake_notify', 'Cron task Shell'));
		$this->hr();
		$this->out(__d('cake_notify', 'This shell is used to execute task scheduled.'));
		$this->out(__d('cake_notify', 'Available tasks: %s.', CakeText::toList(constsVals('CAKE_NOTIFY_CRON_TASK_'), __d('cake_notify', 'and'))));
	}
217440
public function run()
    {
        if ($this->count()) {

            $request = server_request();

            foreach ($this->registry as $offset => $handler) {
                $this->process($request, $handler);
            }
        }
    }
874127
public function execute() {
        global $CFG;

        // Run stats as at the end because they are known to take very long time on large sites.
        if (!empty($CFG->enablestats) and empty($CFG->disablestatsprocessing)) {
            require_once($CFG->dirroot.'/lib/statslib.php');
            // Process configured number of days as max (defaulting to 31).
            $maxdays = empty($CFG->statsruntimedays) ? 31 : abs($CFG->statsruntimedays);
            if (stats_cron_daily($maxdays)) {
                if (stats_cron_weekly()) {
                    if (stats_cron_monthly()) {
                        stats_clean_old();
                    }
                }
            }
            \core_php_time_limit::raise();
        }
    }
1292791
public function run()
    {
        $cli = eZCLI::instance();

        if ( $this->optMemoryMonitoring == true )
        {
            eZLog::rotateLog( self::LOG_FILE );
            $cli->output( "Logging memory usage to " . self::LOG_FILE );
        }

        if ( $this->optIterationSleep > 0 )
            $sleep = ( $this->optIterationSleep * 1000000 );
        else
            $sleep = false;

        $limit = array( 0, $this->optIterationLimit );

        $cli->output( "Purging expired items:" );

        self::monitor( "start" );

        // Fetch a limited list of purge items from the handler itself
        $clusterHandler = eZClusterFileHandler::instance();
        while ( $filesList = $clusterHandler->fetchExpiredItems( $this->optScopes, $limit, $this->optExpiry ) )
        {
            self::monitor( "iteration start" );
            foreach( $filesList as $file )
            {
                $cli->output( "- $file" );
                if ( $this->optDryRun == false )
                {
                    self::monitor( "purge" );
                    $fh = eZClusterFileHandler::instance( $file );
                    $fh->purge( false, false );
                    unset( $fh );
                }
            }
            if ( $sleep !== false )
                usleep( $sleep );

            // the offset only has to be increased in dry run mode
            // since each batch is not deleted
            if ( $this->optDryRun == true )
            {
                $limit[0] += $limit[1];
            }
            self::monitor( "iteration end" );
        }

        self::monitor( "end" );
    }
1000142
public function run()
    {
        // Define a custom error handler so we can log PHP errors
        set_error_handler([\Kotori\Core\Handle::class, 'error']);
        set_exception_handler([\Kotori\Core\Handle::class, 'exception']);
        register_shutdown_function([\Kotori\Core\Handle::class, 'end']);

        Container::get('config')->initialize($this->config);
        Middleware::register('before_app');

        ini_set('date.timezone', Container::get('config')->get('time_zone'));

        // Load application's common functions
        Helper::import(Container::get('config')->get('app_full_path') . '/common.php');

        // @codingStandardsIgnoreStart
        if (function_exists('spl_autoload_register')) {
            spl_autoload_register(['\\Kotori\\Core\\Helper', 'autoload']);
        } else {
            function __autoload($className)
            {
                Helper::autoload($className);
            }
        }
        // @codingStandardsIgnoreEnd

        // Init session
        Container::get('request')->sessionInit();

        Middleware::register('after_app');
        // Load route class
        Container::get('route')->dispatch();
    }
770016
def run(self):
        """"""
        self.logger.debug(f'Running command: {self.cmd}')

        def execute(cmd):
            output = ""
            popen = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
                                     universal_newlines=True, shell=True)
            for stdout_line in iter(popen.stdout.readline, ""):
                stdout_line = stdout_line.strip('\n')
                output += stdout_line
                yield stdout_line
            popen.stdout.close()
            return_code = popen.wait()
            if return_code:
                raise subprocess.CalledProcessError(return_code, cmd, output)

        try:
            for out in execute(self.cmd):
                self.logger.info(out)
            return "", 0
        except subprocess.CalledProcessError as e:
            return e.output, e.returncode
1310598
def run(self, *args, **kwargs) -> Callable:
        
        return self.fn(*args, **kwargs) if args or kwargs else self.fn
668717
def run_plugins(self):
        
        for obj in self.loader.objects:
            # Reserve a slot in the output_dict in order to ensure that the
            # items are in the correct order.
            self.output_dict[obj.output_options['name']] = None
            self.thread_manager.add_thread(obj.main, obj.options['interval'])
1148474
def run_plugins(plugins, url_data, stop_after_match=False, **kwargs):
    """"""
    for plugin in plugins:
        log.debug(LOG_PLUGIN, "Run plugin %s", plugin.__class__.__name__)
        if plugin.applies_to(url_data, **kwargs):
            plugin.check(url_data)
            if stop_after_match:
                break