Load a host-specific config file if configured
This will merge the host specific configuration with the given one
321935
private function load_host_config()
    {
        if (empty($this->prop['include_host_config'])) {
            return;
        }

        foreach (array('HTTP_HOST', 'SERVER_NAME', 'SERVER_ADDR') as $key) {
            $fname = null;
            $name  = $_SERVER[$key];

            if (!$name) {
                continue;
            }

            if (is_array($this->prop['include_host_config'])) {
                $fname = $this->prop['include_host_config'][$name];
            }
            else {
                $fname = preg_replace('/[^a-z0-9\.\-_]/i', '', $name) . '.inc.php';
            }

            if ($fname && $this->load_from_file($fname)) {
                return;
            }
        }
    }
836943
def load_configs(self, filename):
        
        configs = np.loadtxt(filename)
        self.add_to_configs(configs)
659194
def load_merge_candidate(self, filename=None, config=None):
        """"""
        self.config_replace = False
        self._load_candidate(filename, config, False)
68719
def do_bulk_config_update(hostnames):
  
  api = ApiResource(CM_HOST, username=CM_USER, password=CM_PASSWD)
  hosts = collect_hosts(api, hostnames)

  # Set config
  for h in hosts:
    configure_roles_on_host(api, h)
1137118
def load_extra(cls, filename):
    
    try:
      with open(filename, 'rb') as configuration_file:
        cls.load_extra_data(configuration_file.read())
        sys.stderr.write("Config successfully loaded from {0:s}\n".format(
            filename))
        return True
    except IOError:
      return False
1237458
def load_config(deploy_dir):
    '''
    
    '''

    config = Config()
    config_filename = path.join(deploy_dir, 'config.py')

    if path.exists(config_filename):
        extract_file_config(config_filename, config)

        # Now execute the file to trigger loading of any hooks
        exec_file(config_filename)

    return config
497282
def load_config(filename, filepath=''):
    

    FILE = path.join(filepath, filename)

    try:
        cfg.read(FILE)
        global _loaded
        _loaded = True
    except:
        print("configfile not found.")
1307796
def load_inventory(hosts_file=HOSTS_FILE):
    '''
    '''
    inventory = SafeConfigParser(allow_no_value=True)
    if os.path.exists(hosts_file):
        inventory.read(hosts_file)
    else:
        logger.warn('inventory file doesn\'t exist: %s', hosts_file)
    return inventory
983715
def Initialize(config=None,
               external_hostname = None,
               admin_password = None,
               redownload_templates = False,
               repack_templates = True,
               token = None):
  """"""

  print("Checking write access on config %s" % config["Config.writeback"])
  if not os.access(config.parser.filename, os.W_OK):
    raise IOError("Config not writeable (need sudo?)")

  print("\nStep 0: Importing Configuration from previous installation.")
  options_imported = 0
  prev_config_file = config.Get("ConfigUpdater.old_config", default=None)
  if prev_config_file and os.access(prev_config_file, os.R_OK):
    print("Found config file %s." % prev_config_file)
    # pytype: disable=wrong-arg-count
    if builtins.input("Do you want to import this configuration? "
                      "[yN]: ").upper() == "Y":
      options_imported = ImportConfig(prev_config_file, config)
    # pytype: enable=wrong-arg-count
  else:
    print("No old config file found.")

  print("\nStep 1: Setting Basic Configuration Parameters")
  print("We are now going to configure the server using a bunch of questions.")
  ConfigureDatastore(config)
  ConfigureUrls(config, external_hostname=external_hostname)
  ConfigureEmails(config)

  print("\nStep 2: Key Generation")
  if config.Get("PrivateKeys.server_key", default=None):
    if options_imported > 0:
      print("Since you have imported keys from another installation in the "
            "last step,\nyou probably do not want to generate new keys now.")
    # pytype: disable=wrong-arg-count
    if (builtins.input("You already have keys in your config, do you want to"
                       " overwrite them? [yN]: ").upper() or "N") == "Y":
      config_updater_keys_util.GenerateKeys(config, overwrite_keys=True)
    # pytype: enable=wrong-arg-count
  else:
    config_updater_keys_util.GenerateKeys(config)

  FinalizeConfigInit(
      config,
      token,
      admin_password=admin_password,
      redownload_templates=redownload_templates,
      repack_templates=repack_templates,
      prompt=True)
180066
public void load() {

        try {
            File f = new File(persistFile.toString());
            if (f.exists()) {
                // we have V4 config
                loadVer4(persistFile.toString());
            } else {
                String s1 = persistFile.toString().replace("3.xml", "2.xml");
                f = new File(s1);

                if (f.exists()) {
                    loadVer3(s1);
                    this.store();
                    f.delete();
                } else {
                    s1 = persistFile.toString().replace("3.xml", ".xml");
                    f = new File(s1);

                    if (f.exists()) {
                        if (!loadVer1(s1)) {
                            loadVer2(s1);
                        }
                    }

                    this.store();
                    f.delete();
                }
            }

//            File f = new File(persistFile.toString());
//            if (f.exists()) {
//                // we have V3 config
//                loadVer3(persistFile.toString());
//            } else {
//                String s1 = persistFile.toString().replace("2.xml", ".xml");
//                f = new File(s1);
//
//                if (f.exists()) {
//                    if (!loadVer1(s1)) {
//                        loadVer2(s1);
//                    }
//                }
//
//                this.store();
//                f.delete();
//            }
        } catch (XMLStreamException ex) {
            ex.printStackTrace();
            logger.error(String.format("Failed to load the SS7 configuration file. \n%s", ex.getMessage()));
        } catch (FileNotFoundException e) {
            logger.warn(String.format("Failed to load the SS7 configuration file. \n%s", e.getMessage()));
        } catch (IOException e) {
            logger.error(String.format("Failed to load the SS7 configuration file. \n%s", e.getMessage()));
        }
    }
686824
def load(self, filename, replace = False):
		'''  '''

		import os, json, re
		if os.path.exists(filename):
			f = open(filename, 'r')
			content = f.read()
			content = re.sub('[\t ]*?[#].*?\n', '', content)
			try:
				settings = json.loads(content)
			except ValueError:
				# This means that the configuration file is not a valid JSON document
				from lltk.exceptions import ConfigurationError
				raise ConfigurationError('\'' + filename + '\' is not a valid JSON document.')
			f.close()
			if replace:
				self.settings = settings
			else:
				self.settings.update(settings)
		else:
			lltkfilename = self.settings['module-path'] + '/' + self.settings['lltk-config-path'] + filename
			if os.path.exists(lltkfilename):
				# This means that filename was provided relative to the lltk module path
				return self.load(lltkfilename)
			from lltk.exceptions import ConfigurationError
			raise ConfigurationError('\'' + filename + '\' seems to be non-existent.')
531945
def load_config(files=None, root_path=None, local_path=None):
    """"""

    config = cfg.ConfigOpts()
    config.register_opts([
        cfg.Opt('root_path', default=root_path),
        cfg.Opt('local_path', default=local_path),
    ])
    # XXX register actual config groups here
    # theme_group = config_theme.register_config(config)
    if files is not None:
        config(args=[], default_config_files=files)
    return config
475648
def _loadConfiguration(self):
        
        configPath = os.path.join(self.path, "config")
        if not os.path.isdir(configPath):
            return

        config = Config(configPath)

        Config.mergeDictionaries(config.getData(), self.application.config)
869490
def _load_config_file(self):
        """"""
        with open(self._config_file) as f:
            config = yaml.safe_load(f)
            patch_config(config, self.__environment_configuration)
            return config
166425
private function loadingConfig()
    {
        if ($_SERVER['HTTP_HOST'] == SERVER_DEVELOP) {
            if (!is_file(SYSTEM_ROOT . '/config/config.local.php'))
                @copy(SYSTEM_ROOT . '/config/config.sample.php', SYSTEM_ROOT . '/config/config.local.php');
            require_once('config/config.local.php');
        } else {
            if (!is_file(SYSTEM_ROOT . '/config/config.php'))
                @copy(SYSTEM_ROOT . '/config/config.sample.php', SYSTEM_ROOT . '/config/config.php');
            require_once('config/config.php');
        }
    }
1231682
def load_config(filename):
    

    if filename is None:
        filename = ''

    abs_filename = os.path.join(os.getcwd(), filename)

    global FILE

    # find the config file
    if os.path.isfile(filename):
        FILE = filename
    elif os.path.isfile(abs_filename):
        FILE = abs_filename
    elif os.path.isfile(FILE):
        pass
    else:
        if os.path.dirname(filename):
            file_not_found = filename
        else:
            file_not_found = abs_filename
        file_not_found_message(file_not_found)

    # load config
    init(FILE)
998574
protected function loadConfiguration()
    {
        $configPath = __DIR__ . '/../config/onesky.php';

        $this->publishes([
            $configPath => config_path('onesky.php'),
        ], 'config');

        $this->mergeConfigFrom($configPath, 'onesky');
    }