Opens the config file and sets the variable config.

 === Parameters

 @param path [String]
551198
def fetch_variables_config(path)
      descriptor = yaml_content(path)
      @variables = descriptor[::Knowledge.config.environment.to_s] || descriptor
    end
333720
def load_config(self, path):
        ''''''

        # if no path was provided, resort to defaults
        if path == None:
            print("Path to config was null; using defaults.")
            return

        if not os.path.exists(path):
            print("[No user config file found at default location; using defaults.]\n")
            return


        user_config = None

        # read in the user's configuration file (for now, we hope it's yaml)
        with open(path) as f:
            user_config = f.read()

        # load the user's configuration file into a Config object
        extension = os.path.splitext(path)
        if extension == 'yaml':
            user_config = yaml.load(user_config)
        else:
            raise Error('Configuration file type "{}" not supported'.format(extension))

        # copy the user's preferences into the default configurations
        self.merge_config(user_config)

        # build the udpated configuration
        self.configuration = Configuration(self.data_config, self.model_config, self.conversation_config)
15876
def set_api_from_config_path(self) -> None:
        """"""
        config = ConfigParser(allow_no_value=False)
        # TODO: Remove this after this issue https://github.com/python/mypy/issues/2427 is closed
        config.optionxform = str  # type:ignore
        config.read(self.config_path, "utf-8")
        if config.has_option("defaults", "dynamic_loading"):
            dynamic_loading = config.get("defaults", "dynamic_loading")
        else:
            dynamic_loading = "infura"
        self._set_rpc(dynamic_loading)
222505
def set(path, value)
      path = path.split(/\./) if path.is_a?(String)
      target = self
      while path.size > 1
        key = path.shift
        if !(target.key?(key) && target[key].is_a?(::Hash))
          target[key] = Sycl::Hash.new
        else
          target[key] = Sycl::Hash.from_hash(target[key])
        end
        target = target[key]
      end
      target[path.first] = value
    end
393813
def add_config_path(self, path):
        
        abspath = util.abs_pathify(path)
        if abspath not in self._config_paths:
            log.info("Adding {0} to paths to search".format(abspath))
            self._config_paths.append(abspath)
687224
def custom_config_path
      argv.each_with_index do |arg, index|
        if arg == "--config-path" || arg == "-c"
          next_arg = argv[index + 1]
          raise ConfigPathNotProvided.new if next_arg.nil?
          raise ConfigPathInvalid.new(next_arg) unless File.file?(next_arg) && File.readable?(next_arg)
          return next_arg
        end
      end
      nil
    end
1277145
def edit
    @config_var = ConfigVar.where(name: params[:name]).first
    unless @config_var
      @config_var = ConfigVar.new name: params[:name]
      if descriptor = ConfigvarsRails.variable_descriptor(params[:name])
        @config_var.value = descriptor.default_value
      end
    end
  end
617981
def parse_config_file(path: str, final: bool = True) -> None:
    
    return options.parse_config_file(path, final=final)
191503
def read_config(config_path):
    
    section = "DUMMY"
    defaults = {'host': 'localhost',
                'consumerKey': '', 'consumerSecret': '',
                'token': '', 'tokenSecret':'',
                }
    # Insert an section header at the start of the config file,
    # so ConfigParser can understand it
    buf = io.StringIO()
    buf.write('[%s]\n' % section)
    with io.open(config_path, "r") as conf:
        buf.write(conf.read())

    buf.seek(0, os.SEEK_SET)
    parser = ConfigParser()
    parser.optionxform = str # Case-sensitive options
    try:
        parser.read_file(buf) # Python3
    except AttributeError:
        parser.readfp(buf) # Python2

    # Trim quotes
    config = parser.items(section)
    config = [(item[0].replace('"', ''), item[1].replace('"', ''))
              for item in config]
    config = [(item[0].replace("'", ""), item[1].replace("'", ""))
              for item in config]
    config = dict(config)

    # Apply defaults
    for key in defaults:
        if key not in config:
            config[key] = defaults[key]

    return config
1154578
def set_main(key, value, path=MAIN_CF):
    '''
    
    '''
    pairs, conf_list = _parse_main(path)

    new_conf = []
    key_line_match = re.compile("^{0}([\\s=]|$)".format(re.escape(key)))
    if key in pairs:
        for line in conf_list:
            if re.match(key_line_match, line):
                new_conf.append('{0} = {1}'.format(key, value))
            else:
                new_conf.append(line)
    else:
        conf_list.append('{0} = {1}'.format(key, value))
        new_conf = conf_list

    _write_conf(new_conf, path)
    return new_conf
454239
def load_yaml_config_file(path):
    
    result = None
    with open(path, 'r') as steam:
        result = yaml.safe_load(steam)
    return result
497282
def load_config(filename, filepath=''):
    

    FILE = path.join(filepath, filename)

    try:
        cfg.read(FILE)
        global _loaded
        _loaded = True
    except:
        print("configfile not found.")
972293
def init_config
      unless instance_variable_defined? :@hatt_configuration
        @hatt_configuration = TCFG::Base.new

        # build up some default configuration
        @hatt_configuration.tcfg_set 'hatt_services', {}
        @hatt_configuration.tcfg_set 'hatt_globs', DEFAULT_HATT_GLOBS

        @hatt_configuration.tcfg_set_env_var_prefix 'HATT_'
      end

      if hatt_config_file_path
        # if a config file was specified, we assume it exists
        @hatt_configuration.tcfg_config_file hatt_config_file_path
      else
        Log.warn 'No configuration file specified or found. Make a hatt.yml file and point hatt at it.'
      end
      @hatt_configuration.tcfg_set 'hatt_config_file', hatt_config_file_path

      normalize_services_config @hatt_configuration

      nil
    end
1022609
function read_config(path) {
	debug.assert(path).is('string');
	return FS.exists(path).then(function read_file(exists) {
		if(!exists) {
			return {};
		}
		return FS.readFile(path, {'encoding':'utf8'}).then(function parse_json(data) {
			debug.assert(data).is('string');
			return JSON.parse(data);
		});
	}).then(function init_config(config) {
		debug.assert(config).is('object');

		if(config.applications === undefined) {
			config.applications = {};
		}

		return config;
	});
}
398698
def load!(path)
      settings = YAML.load(ERB.new(File.new(path).read).result)
      if settings.present?
        from_hash(settings)
      end
    end
535541
def read_config_file(file)
      @config_hash = YAML.load_file(file)
      @starting_path = File.expand_path(File.split(file).first)
      @config_options = {}
      load_tags
      load_file_exclusions
      load_extension_inclusions
      config_options
    end
952419
void configureFiles(String path) {

        // If the property is set, reload from a local directory:
        if (StringUtils.isNotBlank(path)) {
            configureFilesReloadable(path);
        } else {
            configureFilesResource();
        }
        filesReloadable = filesUrl != null;

        // Communicate:
        showFilesConfiguration();
    }