Run the configuration based on the previously set flags.
508886
public void configure() {
    LOGGER.info("configure()");
    calculators = new ArrayList<>();

    if (fieldExtractorEnabled) {
      fieldExtractor = new FieldExtractor(schema);
      calculators.add(fieldExtractor);
    }

    if (completenessMeasurementEnabled) {
      completenessCalculator = new CompletenessCalculator(schema);
      completenessCalculator.collectFields(completenessCollectFields);
      completenessCalculator.setExistence(fieldExistenceMeasurementEnabled);
      completenessCalculator.setCardinality(fieldCardinalityMeasurementEnabled);
      calculators.add(completenessCalculator);
    }

    if (tfIdfMeasurementEnabled) {
      tfidfCalculator = new TfIdfCalculator(schema);
      if (solrConfiguration != null) {
        tfidfCalculator.setSolrConfiguration(solrConfiguration);
      } else {
        throw new IllegalArgumentException("If TF-IDF measurement is enabled, Solr configuration should not be null.");
      }
      tfidfCalculator.enableTermCollection(collectTfIdfTerms);
      calculators.add(tfidfCalculator);
    }

    if (problemCatalogMeasurementEnabled) {
      if (schema instanceof EdmSchema) {
        ProblemCatalog problemCatalog = new ProblemCatalog((EdmSchema) schema);
        new LongSubject(problemCatalog);
        new TitleAndDescriptionAreSame(problemCatalog);
        new EmptyStrings(problemCatalog);
        calculators.add(problemCatalog);
      }
    }

    if (languageMeasurementEnabled) {
      languageCalculator = new LanguageCalculator(schema);
      calculators.add(languageCalculator);
    }

    if (multilingualSaturationMeasurementEnabled) {
      multilingualSaturationCalculator =
          new MultilingualitySaturationCalculator(schema);
      if (saturationExtendedResult) {
        multilingualSaturationCalculator
          .setResultType(
              MultilingualitySaturationCalculator.ResultTypes.EXTENDED);
      }
      calculators.add(multilingualSaturationCalculator);
    }

    if (uniquenessMeasurementEnabled) {
      if (solrClient == null && solrConfiguration == null) {
        throw new IllegalArgumentException(
          "If Uniqueness measurement is enabled, Solr configuration should not be null."
        );
      }
      if (solrClient == null) {
        solrClient = new DefaultSolrClient(solrConfiguration);
      }
      calculators.add(new UniquenessCalculator(solrClient, schema));
    }
  }
696379
public function run() : void
    {
        /** @var \CaptainHook\App\Config\Hook $hookConfig */
        $hookConfig = $this->config->getHookConfig($this->hook);
        $actions    = $hookConfig->getActions();

        // if hook is not enabled in captainhook configuration skip the execution
        if (!$hookConfig->isEnabled()) {
            $this->io->write($this->formatHookHeadline('Skip'));
            return;
        }
        // if no actions are configured do nothing
        if (count($actions) === 0) {
            $this->io->write(['', '<info>No actions to execute</info>']);
            return;
        }

        $this->io->write($this->formatHookHeadline('Execute'));
        $this->beforeHook();
        foreach ($actions as $action) {
            $this->handleAction($action);
        }
        $this->afterHook();
    }
1374304
def run(self):
        """"""
        config = self.state.document.settings.env.config

        # Group processes by category
        processes = get_processes(config.autoprocess_process_dir, config.autoprocess_source_base_url)
        processes.sort(key=itemgetter('type'))
        processes_by_types = {k: list(g) for k, g in groupby(processes, itemgetter('type'))}

        listnode = nodes.bullet_list()

        for typ in sorted(processes_by_types.keys()):
            par = nodes.paragraph()
            par += nodes.literal(typ, typ)
            par += nodes.Text(' - ')

            processes = sorted(processes_by_types[typ], key=itemgetter('name'))
            last_process = processes[-1]
            for process in processes:
                node = nodes.reference('', process['name'], internal=True)
                node['refuri'] = config.autoprocess_definitions_uri + '#process-' + process['slug']
                node['reftitle'] = process['name']
                par += node
                if process != last_process:
                    par += nodes.Text(', ')

            listnode += nodes.list_item('', par)

        return [listnode]
1211220
public function run()
    {
        $config = Config::get('global.config', 'aliases');
        $alias = new Manager($config['classes']);
        $alias->register();
        $this->container->set('alias', $alias);
    }
369652
def cli_run():
    """"""
    options = CLI.parse_args()
    run(options.CONFIGURATION, options.log_level, options.log_target, options.log_journal)
32042
def run(monitor, directory, *flags, &block)
      result = watch_and_run(monitor, 1, false, directory, *flags, &block)
      result.changes[0].directory = result.directory
      result.changes[0]
    end
1014936
def run(self):
        """"""
        # Lunch a thread for each configuration
        if not self.services:
            self.log.warning("no service checks are configured")
        else:
            self.log.info("going to lunch %s threads", len(self.services))
            if self.config.has_option('daemon', 'splay_startup'):
                splay_startup = self.config.getfloat('daemon', 'splay_startup')
            else:
                splay_startup = None

            for service in self.services:
                self.log.debug("lunching thread for %s", service)
                _config = {}
                for option, getter in SERVICE_OPTIONS_TYPE.items():
                    try:
                        _config[option] = getattr(self.config, getter)(service,
                                                                       option)
                    except NoOptionError:
                        pass  # for optional settings

                _thread = ServiceCheck(service, _config, self.action,
                                       splay_startup)
                _thread.start()

        # Stay running until we are stopped
        while True:
            # Fetch items from action queue
            operation = self.action.get(block=True)

            if isinstance(operation, ServiceCheckDiedError):
                self.log.critical(operation)
                self.log.critical("This is a fatal error and the only way to "
                                  "recover is to restart, thus exiting with a "
                                  "non-zero code and let systemd act by "
                                  "triggering a restart")
                sys.exit(1)

            self.log.info("returned an item from the queue for %s with IP "
                          "prefix %s and action to %s Bird configuration",
                          operation.name,
                          operation.ip_prefix,
                          operation)
            bird_updated = self._update_bird_conf_file(operation)
            self.action.task_done()
            if bird_updated:
                ip_version = operation.ip_version
                if operation.bird_reconfigure_cmd is None:
                    reconfigure_bird(
                        self.bird_configuration[ip_version]['reconfigure_cmd'])
                else:
                    run_custom_bird_reconfigure(operation)
627827
async def update_flags(self, messages: Sequence[MessageT],
                           flag_set: FrozenSet[Flag], mode: FlagOp) -> None:
        
        ...
264847
public function run(): void
    {
        if (!$this->config->isLoadedFromFile()) {
            throw new \RuntimeException('No configuration to edit');
        }

        $this->checkHook();
        $this->checkChange();

        $change = $this->createChange();
        $change->applyTo($this->config);
        Config\Util::writeToDisk($this->config);

        $this->io->write('Configuration successfully updated');
    }
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);
    }
211263
def up(self):
        '''  '''
        # Set new flags
        flags = self.ifflags | IFF_UP
        self.ifflags = flags
        self.get_mtu()
228794
def run(self):
        """"""
        self.signal_init()
        self.listen_init()
        self.logger.info('starting')
        self.loop.start()
1243545
def _create_run_config(options):
        """"""
        values = {opt: getattr(options, opt) for opt in
                       RunConfiguration._fields}
        return RunConfiguration(**values)
1274980
def run_configure(args):
    """"""
    config_path = args.config or bigchaindb.config_utils.CONFIG_DEFAULT_PATH

    config_file_exists = False
    # if the config path is `-` then it's stdout
    if config_path != '-':
        config_file_exists = os.path.exists(config_path)

    if config_file_exists and not args.yes:
        want = input_on_stderr('Config file `{}` exists, do you want to '
                               'override it? (cannot be undone) [y/N]: '.format(config_path))
        if want != 'y':
            return

    conf = copy.deepcopy(bigchaindb.config)

    # select the correct config defaults based on the backend
    print('Generating default configuration for backend {}'
          .format(args.backend), file=sys.stderr)
    database_keys = bigchaindb._database_keys_map[args.backend]
    conf['database'] = bigchaindb._database_map[args.backend]

    if not args.yes:
        for key in ('bind', ):
            val = conf['server'][key]
            conf['server'][key] = input_on_stderr('API Server {}? (default `{}`): '.format(key, val), val)

        for key in ('scheme', 'host', 'port'):
            val = conf['wsserver'][key]
            conf['wsserver'][key] = input_on_stderr('WebSocket Server {}? (default `{}`): '.format(key, val), val)

        for key in database_keys:
            val = conf['database'][key]
            conf['database'][key] = input_on_stderr('Database {}? (default `{}`): '.format(key, val), val)

        for key in ('host', 'port'):
            val = conf['tendermint'][key]
            conf['tendermint'][key] = input_on_stderr('Tendermint {}? (default `{}`)'.format(key, val), val)

    if config_path != '-':
        bigchaindb.config_utils.write_config(conf, config_path)
    else:
        print(json.dumps(conf, indent=4, sort_keys=True))
    print('Configuration written to {}'.format(config_path), file=sys.stderr)
    print('Ready to go!', file=sys.stderr)
283522
def run(self):
        
        self.find_new()
        for n in self.news:
            print("{0}".format(n))
        print("")
        self.msg.template(78)
        print("| Installed {0} new configuration files:".format(
            len(self.news)))
        self.msg.template(78)
        self.choices()
544156
def run():
    """"""
    # create a arg parser and configure it.
    parser = argparse.ArgumentParser(description='SharQ Server.')
    parser.add_argument('-c', '--config', action='store', required=True,
                        help='Absolute path of the SharQ configuration file.',
                        dest='sharq_config')
    parser.add_argument('-gc', '--gunicorn-config', action='store', required=False,
                        help='Gunicorn configuration file.',
                        dest='gunicorn_config')
    parser.add_argument('--version', action='version', version='SharQ Server %s' % __version__)
    args = parser.parse_args()

    # read the configuration file and set gunicorn options.
    config_parser = ConfigParser.SafeConfigParser()
    # get the full path of the config file.
    sharq_config  = os.path.abspath(args.sharq_config)
    config_parser.read(sharq_config)

    host = config_parser.get('sharq-server', 'host')
    port = config_parser.get('sharq-server', 'port')
    bind = '%s:%s' % (host, port)
    try:
        workers = config_parser.get('sharq-server', 'workers')
    except ConfigParser.NoOptionError:
        workers = number_of_workers()

    try:
        accesslog = config_parser.get('sharq-server', 'accesslog')
    except ConfigParser.NoOptionError:
        accesslog = None

    options = {
        'bind': bind,
        'workers': workers,
        'worker_class': 'gevent'  # required for sharq to function.
    }
    if accesslog:
        options.update({
            'accesslog': accesslog
        })

    if args.gunicorn_config:
        gunicorn_config = os.path.abspath(args.gunicorn_config)
        options.update({
            'config': gunicorn_config
        })

    print """
      ___ _              ___    ___
     / __| |_  __ _ _ _ / _ \  / __| ___ _ ___ _____ _ _
     \__ \ ' \/ _` | '_| (_) | \__ \/ -_) '_\ V / -_) '_|
     |___/_||_\__,_|_|  \__\_\ |___/\___|_|  \_/\___|_|

    Version: %s

    Listening on: %s
    """ % (__version__, bind)
    server = setup_server(sharq_config)
    SharQServerApplicationRunner(server.app, options).run()
1297176
def run(self):
        """"""
        _check_directory(self.directory)

        with DirectoryContextManager(self.directory):
            process = subprocess.Popen(self.arguments, shell=self._shell, env=self.env)

            _, _ = process.communicate()

        returncode = process.returncode

        if returncode != 0 and not self._ignore_errors:
            raise CommandError(
                '"{0}" failed (err code {1})'.format(self.__repr__(), returncode)
            )