This method runs the the plugin in the appropriate mode parsed from
        the command line options.
164636
def run(self):
        '''
        '''
        handle = 0
        handlers = {
           Modes.ONCE: once,
           Modes.CRAWL: crawl,
           Modes.INTERACTIVE: interactive,
        }
        handler = handlers[self.mode]
        patch_sysargv(self.url or 'plugin://%s/' % self.plugin.id, handle)
        return handler(self.plugin)
460300
protected function executePluginParsers()
	{
		foreach ($this->pluginsConfig as $pluginName => $pluginConfig)
		{
			if (empty($pluginConfig['isDisabled']))
			{
				$this->executePluginParser($pluginName);
			}
		}
	}
792730
function _run_mod_handler()
	{
		$_args = func_get_args();
		list($_modifier_name, $_map_array) = array_splice($_args, 0, 2);
		list($_func_name, $_tpl_file, $_tpl_line) =
		$this->_plugins['modifier'][$_modifier_name];

		$_var = $_args[0];
		foreach ($_var as $_key => $_val) {
			$_args[0] = $_val;
			$_var[$_key] = call_user_func_array($_func_name, $_args);
		}
		return $_var;
	}
332661
def main():
    
    try:
        # A bit of a hack: We want to load the plugins (specified via the mode
        # and health parameter) in order to add their arguments to the argument
        # parser. But this means we first need to look into the CLI arguments
        # to find them ... before looking at the arguments. So we first perform
        # a manual search through the argument list for this purpose only.
        args = sys.argv[1:]

        # Loading the watcher plugin
        mode_name = utils.param_extract(args, "-m", "--mode", default=None)
        if mode_name:
            watcher_plugin_class = \
                load_plugin(mode_name, watcher.WATCHER_DEFAULT_PLUGIN_MODULE)
        else:
            watcher_plugin_class = None

        # Loading the health monitor plugin
        health_check_name = \
            utils.param_extract(args, "-H", "--health",
                                default=monitor.MONITOR_DEFAULT_PLUGIN)
        if health_check_name:
            health_plugin_class = \
                load_plugin(health_check_name,
                            monitor.MONITOR_DEFAULT_PLUGIN_MODULE)
        else:
            health_plugin_class = None

        # Provide complete arg parsing for vpcrouter and all plugin classes.
        conf = _parse_args(sys.argv[1:],
                           watcher_plugin_class, health_plugin_class)

        if not health_plugin_class or not watcher_plugin_class:
            logging.error("Watcher plugin or health monitor plugin class "
                          "are missing.")
            sys.exit(1)

        _setup_logging(conf)

        # If we are on an EC2 instance then some data is already available to
        # us. The return data items in the meta data match some of the command
        # line arguments, so we can pass this through to the parser function to
        # provide defaults for those parameters. Specifically: VPC-ID and
        # region name.
        if not conf['vpc_id'] or not conf['region_name']:
            meta_data = get_ec2_meta_data()
            if 'vpc_id' not in meta_data or 'region_name' not in meta_data:
                logging.error("VPC and region were not explicitly specified "
                              "and can't be auto-discovered.")
                sys.exit(1)
            else:
                conf.update(meta_data)

        try:
            info_str = "vpc-router (%s): mode: %s (%s), " \
                       "health-check: %s (%s)" % \
                       (vpcrouter.__version__,
                        conf['mode'], watcher_plugin_class.get_version(),
                        health_check_name, health_plugin_class.get_version())
            logging.info("*** Starting %s ***" % info_str)
            CURRENT_STATE.versions = info_str

            http_srv = http_server.VpcRouterHttpServer(conf)
            CURRENT_STATE._vpc_router_http = http_srv

            watcher.start_watcher(conf,
                                  watcher_plugin_class, health_plugin_class)
            http_srv.stop()
            logging.info("*** Stopping vpc-router ***")
        except Exception as e:
            import traceback
            traceback.print_exc()
            logging.error(e.message)
            logging.error("*** Exiting")
    except Exception as e:
        print "\n*** Error: %s\n" % e.message

    sys.exit(1)
667712
def run_command(self, command, arg=None, is_eval=False):
        
        mode = is_eval and 'eval' or 'command'

        if isinstance(arg, tuple):
            name, d = arg
        else:
            name, d = arg, {}

        result = getattr(self.connection.admin, mode)(command, name, **d)
        return result
547700
public void run() {

		if (!initProxy()) {
			// Check if we have been aborted
			if (mode != OK_MODE)
				return;
			if (net_thread != Thread.currentThread())
				return;

			mode = COMMAND_MODE;
			warning_label.setText("Look up failed.");
			warning_label.invalidate();
			return;
		}

		// System.out.println("Done!");
		while (!warning_dialog.isShowing())
			; /* do nothing */
		;

		warning_dialog.dispose();
		// dispose(); //End Dialog
	}
816819
def run_from_argv(self, prog, subcommand, global_options, argv):
        
        self.prog_name = prog
        if self.skip_options:
            parser = NewOptionParser(prog=self.prog_name,
                     usage=self.usage(subcommand),
                    version='',
                    formatter = NewFormatter(),
                     add_help_option = False,
                     option_list=self.option_list)
        else:
            parser = self.create_parser(prog, subcommand)
        options, args = parser.parse_args(argv)
        self.execute(args, options, global_options)
318437
def run(self, args):
        
        logging.basicConfig(stream=sys.stdout, level=logging.INFO)
        configuration = self.configuration
        configuration.locale_dir.parent.makedirs_p()
        # pylint: disable=attribute-defined-outside-init
        self.source_msgs_dir = configuration.source_messages_dir

        # The extraction process clobbers django.po and djangojs.po.
        # Save them so that it won't do that.
        self.rename_source_file('django.po', 'django-saved.po')
        self.rename_source_file('djangojs.po', 'djangojs-saved.po')

        # Extract strings from mako templates.
        verbosity_map = {
            0: "-q",
            1: "",
            2: "-v",
        }
        babel_verbosity = verbosity_map.get(args.verbose, "")

        if args.verbose:
            stderr = None
        else:
            stderr = DEVNULL

        # --keyword informs Babel that `interpolate()` is an expected
        # gettext function, which is necessary because the `tokenize` function
        # in the `markey` module marks it as such and passes it to Babel.
        # (These functions are called in the django-babel-underscore module.)
        babel_cmd_template = (
            'pybabel {verbosity} extract --mapping={config} '
            '--add-comments="Translators:" --keyword="interpolate" '
            '. --output={output}'
        )

        babel_mako_cfg = self.base(configuration.locale_dir, 'babel_mako.cfg')
        if babel_mako_cfg.exists():
            babel_mako_cmd = babel_cmd_template.format(
                verbosity=babel_verbosity,
                config=babel_mako_cfg,
                output=self.base(configuration.source_messages_dir, 'mako.po'),
            )

            execute(babel_mako_cmd, working_directory=configuration.root_dir, stderr=stderr)

        babel_underscore_cfg = self.base(configuration.locale_dir, 'babel_underscore.cfg')
        if babel_underscore_cfg.exists():
            babel_underscore_cmd = babel_cmd_template.format(
                verbosity=babel_verbosity,
                config=babel_underscore_cfg,
                output=self.base(configuration.source_messages_dir, 'underscore.po'),
            )

            execute(babel_underscore_cmd, working_directory=configuration.root_dir, stderr=stderr)

        makemessages = "django-admin.py makemessages -l en -v{}".format(args.verbose)
        ignores = " ".join('--ignore="{}/*"'.format(d) for d in configuration.ignore_dirs)
        if ignores:
            makemessages += " " + ignores

        # Extract strings from django source files (*.py, *.html, *.txt).
        make_django_cmd = makemessages + ' -d django'
        execute(make_django_cmd, working_directory=configuration.root_dir, stderr=stderr)

        # Extract strings from Javascript source files (*.js, *jsx).
        make_djangojs_cmd = makemessages + ' -d djangojs -e js,jsx'
        execute(make_djangojs_cmd, working_directory=configuration.root_dir, stderr=stderr)

        # makemessages creates 'django.po'. This filename is hardcoded.
        # Rename it to django-partial.po to enable merging into django.po later.
        self.rename_source_file('django.po', 'django-partial.po')

        # makemessages creates 'djangojs.po'. This filename is hardcoded.
        # Rename it to djangojs-partial.po to enable merging into djangojs.po later.
        self.rename_source_file('djangojs.po', 'djangojs-partial.po')

        files_to_clean = set()

        # Extract strings from third-party applications.
        for app_name in configuration.third_party:
            # Import the app to find out where it is.  Then use pybabel to extract
            # from that directory.
            app_module = importlib.import_module(app_name)
            app_dir = Path(app_module.__file__).dirname().dirname()  # pylint: disable=no-value-for-parameter
            output_file = self.source_msgs_dir / (app_name + ".po")
            files_to_clean.add(output_file)

            babel_cmd = 'pybabel {verbosity} extract -F {config} -c "Translators:" {app} -o {output}'
            babel_cmd = babel_cmd.format(
                verbosity=babel_verbosity,
                config=configuration.locale_dir / 'babel_third_party.cfg',
                app=app_name,
                output=output_file,
            )
            execute(babel_cmd, working_directory=app_dir, stderr=stderr)

        # Segment the generated files.
        segmented_files = segment_pofiles(configuration, configuration.source_locale)
        files_to_clean.update(segmented_files)

        # Finish each file.
        for filename in files_to_clean:
            LOG.info('Cleaning %s', filename)
            pofile = polib.pofile(self.source_msgs_dir.joinpath(filename))
            # replace default headers with edX headers
            fix_header(pofile)
            # replace default metadata with edX metadata
            fix_metadata(pofile)
            # remove key strings which belong in messages.po
            strip_key_strings(pofile)
            pofile.save()

        # Restore the saved .po files.
        self.rename_source_file('django-saved.po', 'django.po')
        self.rename_source_file('djangojs-saved.po', 'djangojs.po')
492035
public void run() {

        try {
            // add a list of plugins to execute
            // be sure to use the right order
            m_plugins = new ArrayList<I_CmsUpdateDBPart>();

            if (getDetectedVersion() < 7) {
                m_plugins.add(new org.opencms.setup.db.update6to7.CmsUpdateDBDropOldIndexes());
                m_plugins.add(new org.opencms.setup.db.update6to7.CmsUpdateDBUpdateOU());
                m_plugins.add(new org.opencms.setup.db.update6to7.CmsUpdateDBCmsUsers());
                m_plugins.add(new org.opencms.setup.db.update6to7.CmsUpdateDBProjectId());
                m_plugins.add(new org.opencms.setup.db.update6to7.CmsUpdateDBNewTables());
                m_plugins.add(new org.opencms.setup.db.update6to7.CmsUpdateDBHistoryTables());
                m_plugins.add(new org.opencms.setup.db.update6to7.CmsUpdateDBHistoryPrincipals());
                m_plugins.add(new org.opencms.setup.db.update6to7.CmsUpdateDBDropUnusedTables());
                m_plugins.add(new org.opencms.setup.db.update6to7.CmsUpdateDBContentTables());
                m_plugins.add(new org.opencms.setup.db.update6to7.CmsUpdateDBAlterTables());
                m_plugins.add(new org.opencms.setup.db.update6to7.CmsUpdateDBDropBackupTables());
                m_plugins.add(new org.opencms.setup.db.update6to7.CmsUpdateDBCreateIndexes7());
            } else {
                m_plugins.add(new org.opencms.setup.db.update7to8.CmsUpdateDBNewTables());
                m_plugins.add(new org.opencms.setup.db.update7to8.CmsUpdatePasswordColumn());
            }
        } catch (Throwable t) {
            t.printStackTrace();
            throw new RuntimeException(t);
        }

        Iterator<String> it = getPools().iterator();
        while (it.hasNext()) {
            String dbPool = it.next();
            System.out.println("Starting DB Update for pool " + dbPool + "... ");

            try {
                updateDatabase(dbPool);
            } catch (Throwable t) {
                t.printStackTrace();
            }

            System.out.println("... DB Update finished for " + dbPool + ".");
        }
    }
480976
def run(self):
        
        os.environ['JARN_RUN'] = '1'
        self.python.check_valid_python()

        args = self.parse_options(self.args)
        if args:
            arg = args[0]
        else:
            arg = os.curdir
        if arg:
            arg = expanduser(arg)

        if isfile(arg):
            outfile = self.render_file(arg)
        elif isdir(arg):
            outfile = self.render_long_description(arg)
        else:
            err_exit('No such file or directory: %s' % arg)

        self.open_in_browser(outfile)
659840
def run_from_cli(self, args):
        
        if args['--dump-config']:
            self._config.print_config()
        else:
            stdout, stderr = self.lint(args['<path>'])
            self.print_results(stdout, stderr)
1124399
def run(plugins):
    '''
    
    '''
    all_plugins = list_plugins()

    if isinstance(plugins, six.string_types):
        plugins = plugins.split(',')

    data = {}
    for plugin in plugins:
        if plugin not in all_plugins:
            continue
        data[plugin] = {}
        muninout = __salt__['cmd.run'](
                'munin-run {0}'.format(plugin),
                python_shell=False)
        for line in muninout.split('\n'):
            if 'value' in line:  # This skips multigraph lines, etc
                key, val = line.split(' ')
                key = key.split('.')[0]
                try:
                    # We only want numbers
                    if '.' in val:
                        val = float(val)
                    else:
                        val = int(val)
                    data[plugin][key] = val
                except ValueError:
                    pass
    return data
201876
def launch(self, args=None):
        
        self.options = self.parse_args(args)
        if self.options.saveinputmeta:
            # save original input options
            self.save_input_meta()
        if self.options.inputmeta:
            # read new options from JSON file
            self.options = self.get_options_from_file(self.options.inputmeta)
        self.run(self.options)
        # if required save meta data for the output after running the plugin app
        if self.options.saveoutputmeta:
            self.save_output_meta()
1316319
public function run()
    {
        // if there is no renderTo id, build the layer with current id and initialize renderTo option
        if (!isset($this->pluginOptions['chart']) || !isset($this->pluginOptions['chart']['renderTo'])) {
            echo CHtml::openTag('div', $this->htmlOptions);
            echo CHtml::closeTag('div');

            if (isset($this->pluginOptions['chart']) && is_array($this->pluginOptions['chart'])) {
                $this->pluginOptions['chart']['renderTo'] = $this->htmlOptions['id'];
            } else {
                $this->pluginOptions['chart'] = array('renderTo' => $this->htmlOptions['id']);
            }

        }
        $this->registerClientScript();
    }
543241
function run()
    {
        if (strpos($this->cmd, ':') !== false) {
            $tmp = explode(':', $this->cmd);
            $this->cmd = $tmp[0];
            $this->subCmd = $tmp[1];
        } else {
            $this->subCmd = false;
        }

            //Select
        switch ($this->cmd) {
            case 'css':
                $this->cmdCss();
                break;

            case 'js':
                $this->cmdJs();
                break;
            
            case 'all':
                $this->cmdAll();
                break;

            case 'jss':
                $this->cmdJss();
                break;

            default:
                echo "\n\n  Command \"optimize:".$this->cmd."\" not exists!";
                exit(Main::help());
            break;
        }
            return;
    }
1251478
def run(main=None, argv=None):
    """"""

    # Define help flags.
    _define_help_flags()

    # Parse known flags.
    argv = flags.FLAGS(_sys.argv if argv is None else argv, known_only=True)

    main = main or _sys.modules['__main__'].main

    # Call the main function, passing through any arguments
    # to the final program.
    _sys.exit(main(argv))
557925
def run_from_argv(self, argv):
        
        if (len(argv) > 2 and not argv[2].startswith('-') and
                argv[2] in self.subcommands.keys()):
            subcommand = argv[2]
            klass = self.get_subcommand(subcommand)
            parser = OptionParser(
                prog=argv[0],
                usage=klass.usage('{0} {1}'.format(argv[1], subcommand)),
                version=klass.get_version(), option_list=klass.option_list)
            options, args = parser.parse_args(argv[3:])
            args = [subcommand] + args
        else:
            parser = self.create_parser(argv[0], argv[1])
            options, args = parser.parse_args(argv[2:])

        handle_default_options(options)
        self.execute(*args, **options.__dict__)