Initialize metaconfig for provisioning self.
486567
def _metaconfigure(self, argv=None):
        """"""
        metaconfig = self._get_metaconfig_class()
        if not metaconfig:
            return
        if self.__class__ is metaconfig:
            # don't get too meta
            return
        override = {
            'conflict_handler': 'resolve',
            'add_help': False,
            'prog': self._parser_kwargs.get('prog'),
        }
        self._metaconf = metaconfig(**override)
        metaparser = self._metaconf.build_parser(
            options=self._metaconf._options, permissive=False, **override)
        self._parser_kwargs.setdefault('parents', [])
        self._parser_kwargs['parents'].append(metaparser)
        self._metaconf._values = self._metaconf.load_options(
            argv=argv)
        self._metaconf.provision(self)
1186884
def init_app(self, app):
        """"""
        self.init_config(app)
        if app.config['LOGGING_FS_LOGFILE'] is None:
            return
        self.install_handler(app)
        app.extensions['invenio-logging-fs'] = self
216880
def Init():
  """"""
  global INIT_RAN
  if INIT_RAN:
    return

  # Set up a temporary syslog handler so we have somewhere to log problems
  # with ConfigInit() which needs to happen before we can start our create our
  # proper logging setup.
  syslog_logger = logging.getLogger("TempLogger")
  if os.path.exists("/dev/log"):
    handler = logging.handlers.SysLogHandler(address="/dev/log")
  else:
    handler = logging.handlers.SysLogHandler()
  syslog_logger.addHandler(handler)

  try:
    config_lib.SetPlatformArchContext()
    config_lib.ParseConfigCommandLine()
  except config_lib.Error:
    syslog_logger.exception("Died during config initialization")
    raise

  metric_metadata = server_metrics.GetMetadata()
  metric_metadata.extend(communicator.GetMetricMetadata())

  stats_collector = prometheus_stats_collector.PrometheusStatsCollector(
      metric_metadata, registry=prometheus_client.REGISTRY)
  stats_collector_instance.Set(stats_collector)

  server_logging.ServerLoggingStartupInit()

  bs_registry_init.RegisterBlobStores()
  all_decoders.Register()
  all_parsers.Register()
  registry.Init()

  # Exempt config updater from this check because it is the one responsible for
  # setting the variable.
  if not config.CONFIG.ContextApplied("ConfigUpdater Context"):
    if not config.CONFIG.Get("Server.initialized"):
      raise RuntimeError("Config not initialized, run \"grr_config_updater"
                         " initialize\". If the server is already configured,"
                         " add \"Server.initialized: True\" to your config.")

  INIT_RAN = True
780859
def post_ext_init(state):
    """"""
    app = state.app

    app.config.setdefault(
        'OAUTHCLIENT_SITENAME',
        app.config.get('THEME_SITENAME', 'Invenio'))
    app.config.setdefault(
        'OAUTHCLIENT_BASE_TEMPLATE',
        app.config.get('BASE_TEMPLATE',
                       'invenio_oauthclient/base.html'))
    app.config.setdefault(
        'OAUTHCLIENT_COVER_TEMPLATE',
        app.config.get('COVER_TEMPLATE',
                       'invenio_oauthclient/base_cover.html'))
    app.config.setdefault(
        'OAUTHCLIENT_SETTINGS_TEMPLATE',
        app.config.get('SETTINGS_TEMPLATE',
                       'invenio_oauthclient/settings/base.html'))
417515
def init_app(self, app):
        """"""
        self.init_config(app)
        state = _OAuthClientState(app)
        app.extensions['invenio-oauthclient'] = state
        return state
681992
def init_app(self, app):
        """"""
        self.init_config(app)
        self.cache = Cache(app)
        self.is_authenticated_callback = _callback_factory(
            app.config['CACHE_IS_AUTHENTICATED_CALLBACK'])
        app.extensions['invenio-cache'] = self
956153
protected function initConfig(): void
    {
        $loader = new ConfigLoader();
        $loader->setPath($this->getPath());
        $loader->setEnvironment($this->getEnvironment());
        $loader->load();

        $config = new \Bluz\Config\Config();
        $config->setFromArray($loader->getConfig());

        Config::setInstance($config);

        // setup configuration for current environment
        if ($debug = Config::get('debug')) {
            $this->debugFlag = (bool)$debug;
        }

        // initial php settings
        if ($ini = Config::get('php')) {
            foreach ($ini as $key => $value) {
                $result = ini_set($key, $value);
                Logger::info('app:init:php:' . $key . ':' . ($result ?: '---'));
            }
        }
    }
1049131
def _init():
    
    global finder

    if finder is None:
        finder = ModuleFinder()

    if finder not in sys.meta_path:
        sys.meta_path.insert(0, finder)
228107
protected function initConfiguration()
    {
        $tsfe = self::getTsfe();

        // Get configuration
        if (!empty($tsfe->tmpl->setup['plugin.']['metaseo.'])) {
            $this->conf = $tsfe->tmpl->setup['plugin.']['metaseo.'];
        }

        // Store blacklist configuration
        if (!empty($this->conf['sitemap.']['index.']['blacklist.'])) {
            $this->blacklistConf = $this->conf['sitemap.']['index.']['blacklist.'];
        }

        // Store blacklist configuration
        if (!empty($this->conf['sitemap.']['index.']['fileExtension.'])) {
            # File extensions can be a comma separated list
            foreach ($this->conf['sitemap.']['index.']['fileExtension.'] as $fileExtListRaw) {
                $fileExtList       = Typo3GeneralUtility::trimExplode(',', $fileExtListRaw);
                $this->fileExtList = array_merge($this->fileExtList, $fileExtList);
            };
        }

        // Get expiration
        $expirationInDays = 60;
        if (!empty($this->conf['sitemap.']['expiration'])) {
            $expirationInDays = abs($this->conf['sitemap.']['expiration']);
        }

        $this->indexExpiration = $_SERVER['REQUEST_TIME'] + ($expirationInDays * 24 * 60 * 60);

        // Init blacklist for doktype (from table pages)
        $this->doktypeBlacklist = SitemapUtility::getDoktypeBlacklist();

        // Init blacklist for PAGE typenum
        $this->pageTypeBlacklist = SitemapUtility::getPageTypeBlacklist();
    }
1363826
private function _initialize()
    {
        $params = $this->getParameters();
        if ($params) {
            foreach ($params as $param) {
                if ($param->getType() == "config") {
                    $this->configParameters[] = $param;
                } else {
                    if ($param->getName() == "encoding") {
                        $this->setEncoding($param->getValue());
                    }
                }
            }
        }
    }
66338
def init_config(self):
        """"""

        input_fpath = os.path.join(self.work_path, 'input.nml')

        input_nml = f90nml.read(input_fpath)

        if self.expt.counter == 0 or self.expt.repeat_run:
            input_type = 'n'
        else:
            input_type = 'r'
        input_nml['MOM_input_nml']['input_filename'] = input_type

        f90nml.write(input_nml, input_fpath, force=True)
39718
def setup_config(command, filename, section, vars):
    """"""
    confuri = "config:" + filename
    if ":" in section:
        confuri += "#" + section.rsplit(":", 1)[-1]
    conf = appconfig(confuri)

    load_environment(conf.global_conf, conf.local_conf)
1300677
public function init()
    {
        // Check filepath
        if (empty($this->filepath)) {
            return;
        }

        // Get configurations
        $configs = include $this->filepath;

        // Check
        if (empty($configs)) {
            return;
        }

        // Iterate on configs
        foreach ($configs as $key => $description) {
            $this->addMenu($key, $description);
        }
    }
748686
def init():
    """"""
    default_config_path = path.join(
        (os.environ.get('TLDR_CONFIG_DIR') or path.expanduser('~')),
        '.tldrrc')
    if path.exists(default_config_path):
        click.echo("There is already a config file exists, "
                   "skip initializing it.")
    else:
        repo_path = click.prompt("Input the tldr repo path(absolute path)")
        if not path.exists(repo_path):
            sys.exit("Repo path not exist, clone it first.")

        platform = click.prompt("Input your platform(linux, osx or sunos)")
        if platform not in ['linux', 'osx', 'sunos']:
            sys.exit("Platform should be in linux, osx or sunos.")

        colors = {
            "description": "blue",
            "usage": "green",
            "command": "cyan"
        }

        config = {
            "repo_directory": repo_path,
            "colors": colors,
            "platform": platform
        }
        with open(default_config_path, 'w') as f:
            f.write(yaml.safe_dump(config, default_flow_style=False))

        click.echo("Initializing the config file at {0}".format(
            default_config_path))
1347804
def init():
    
    global sqs, logs, config
    if config is None:
        with open('config.json') as fh:
            config = json.load(fh)
    if sqs is None:
        sqs = boto3.client('sqs')
    if logs is None:
        logs = boto3.client('logs')
570902
protected function initConfig()
    {
        if (isset($this->settings) || $this->settings->exists('config')) {
            $this->config->setDefinition($this->settings->get('config'));
        }
    }
1117878
def init_app(self, app):
        """"""
        self.init_config(app)
        app.extensions['inspire-crawler'] = self
        app.cli.add_command(crawler_cmd)