Load the settings from a compliant Qualys.yml file. This can be used for
 easy setup with frameworks other than Rails.

 @example Configure Qualys.
   Qualys.load!("/path/to/qualys.yml")

 @param [ String ] path The path to the file.
498686
def load!(path)
      settings = YAML.safe_load(ERB.new(File.new(path).read).result)['api']
      from_hash(settings) if settings.is_a? Hash
    end
726288
def load_file(path):
    
    res = {}

    if not path:
        IOError("No path specified to save")

    if not os.path.isfile(path):
        raise IOError("File not found {}".format(path))

    try:
        with io.open(path, "r", encoding="utf-8") as f:
            if path.endswith(".json"):
                res = load_json_file(f)
            elif path.endswith(".yaml") or path.endswith(".yml"):
                res = load_yaml_file(f)
    except IOError:
        raise
    except Exception as e:
        raise IOError(e)
    return res
1298275
def load_by_name name
      path = self.locate_definition name
      raise TargetLoadError.new("Target definition file does not exist for #{name}") if path.nil?
      config = YAML::load_file(path)
      raise TargetLoadError.new("Target definition file #{path} is not valid YAML") if config.nil?
      config = config.deep_symbolize
      self.store_config config
      self.check_constructor name
      self.load_constructor
    end
462995
def parse_yaml(file)
      file_content = File.exist?(file) ? ERB.new(File.read(file)).result : '---'

      config = YAML.load(file_content) || {}
      env    = ENV['RAILS_ENV'] || ENV['RACK_ENV'] || ENV['APP_CONFIG_ENV']

      config_from config['default'], config[env]
    end
15498
def load_config(path):
   
   with path.open('rb') as fi:
       file_bytes = fi.read()
       config = yaml.load(file_bytes.decode('utf-8'))

   return config
980739
def load_path(path)
      path = path.to_s
      check_error_string do
        @path = Pathname.new(path)
        load_path_impl(path)
      end
      self
    end
705909
def load_config_at_path(path):
    
    if path.exists() and path.is_file():
        with path.open('r') as f:
            return yaml.load(f, Loader=yaml.SafeLoader)
    else:
        raise ConfigurationError("Couldn't find ballet.yml config file.")
870225
def load
      close if @loaded

      @path.each do |file|
        next unless File.exist?(file)
        @settings = Psych.load_file(file)
        next unless @settings.include?(@namespace)
        parse(@settings[@namespace])
        @loaded = true
        break
      end

      fail unless @loaded
    end
821080
def load_settings_file(self, settings_file=None):
        

        if not settings_file:
            settings_file = self.get_json_or_yaml_settings()
        if not os.path.isfile(settings_file):
            raise ClickException("Please configure your zappa_settings file or call `zappa init`.")

        path, ext = os.path.splitext(settings_file)
        if ext == '.yml' or ext == '.yaml':
            with open(settings_file) as yaml_file:
                try:
                    self.zappa_settings = yaml.load(yaml_file)
                except ValueError: # pragma: no cover
                    raise ValueError("Unable to load the Zappa settings YAML. It may be malformed.")
        elif ext == '.toml':
            with open(settings_file) as toml_file:
                try:
                    self.zappa_settings = toml.load(toml_file)
                except ValueError: # pragma: no cover
                    raise ValueError("Unable to load the Zappa settings TOML. It may be malformed.")
        else:
            with open(settings_file) as json_file:
                try:
                    self.zappa_settings = json.load(json_file)
                except ValueError: # pragma: no cover
                    raise ValueError("Unable to load the Zappa settings JSON. It may be malformed.")
87530
def __load_settings(self):
        
        #file_path = path.relpath(settings_file_path)
        #file_path = path.abspath(settings_file_path)
        file_path = self.file_path

        try:
            self.data = json.load(open(file_path))
        except FileNotFoundError:
            print("Could not load", file_path)
238563
def load config_file
      config_file ||= @config_file
      newsets = YAML::load_file(config_file)
      raise 'Config file was not valid YAML' if newsets == false
      newsets.deep_symbolize.each_pair do |key, value|
        varname = "@#{key.to_s}".to_sym
        unless self.instance_variables.include? varname
          raise SettingsError.new "Key #{key.to_s} in settings file is not valid"
        end
        self.instance_variable_set(varname, value)
      end
    end
795046
def load_tokens
      if File.exists?(TOKEN_PATH)
        f = File.open(TOKEN_PATH, 'r')
        tokens = YAML::load(f)
        f.close
        tokens
      end
    end
849796
def load_model_data(self, path, model):
        
        if os.path.isdir(path):
            # try find a model data collection
            if os.path.isfile(os.path.join(path, '_all.yml')):
                self.load_model_data_collection(path, model)
            self.load_model_data_from_files(path, model)
            self.session.commit()
1089387
public void readResources(String path) throws IOException {
		Enumeration<URL> resources =
				getClass().getClassLoader().getResources(path);

		if (!resources.hasMoreElements()) {
			throw new IllegalArgumentException(String.format("File %s was not found on classpath", path));
		}

		Yaml yaml = new Yaml();
		while (resources.hasMoreElements()) {
			appendData(yaml.loadAs(resources.nextElement().openStream(), Data.class));
		}
	}
502564
def load_file(path)
      d = YAML.load_file(path)

      if d.is_a?(Hash) 
        d = HashWithIndifferentAccess.new(d)
        e = Evaluator.new(d)
        d = process(d, e)
      end

      @data[File.basename(path, ".yml").downcase] = d
    end
1247473
def load_from_file(self, file_path, format=None):
        
        if format is None:
            base_name, file_extension = os.path.splitext(file_path)
            if file_extension in (".yaml", ".yml"):
                format = "yaml"
            elif file_extension in (".json"):
                format = "json"
            else:
                raise ValueError("Config file \"%s\" undetermined" % file_extension)

        if format == "yaml":
            return yaml.load(open(file_path), Loader=yaml.CSafeLoader if yaml.__with_libyaml__ else yaml.SafeLoader)
        elif format == "json":
            return json.load(open(file_path))
        else:
            raise ValueError("Format \"%s\" unknwon" % format)
305322
async function loadConfigFile(filePath) {
  const f = await Promise.any(
    _.map(['.yml', '.yaml', '.json', ''], async(ext) =>
      await utils.fileExists(`${filePath}${ext}`)));
  if (f) {
    return loadYaml(await fs.readFileAsync(f));
  }
  return undefined;
}