select_multiple_from

 YAML File loading/store 

 Return the yaml content as a Hash object
495934
def load_config(file)
      unless File.exist?(file)
        raise FalkorLib::Error, "Unable to find the YAML file '#{file}'"
      end
      loaded = YAML.load_file(file)
      unless loaded.is_a?(Hash)
        raise FalkorLib::Error, "Corrupted or invalid YAML file '#{file}'"
      end
      loaded
    end
975514
def dump(filename)
      File.open(filename,'w') do |f|
        YAML.dump(self.to_hash,f)
      end
    end
1240042
def read_cache
      return nil unless File.readable_real?(CACHE_PATH)
      index = YAML::load_file(CACHE_PATH)
      return nil unless index.created_version == Pro::VERSION
      return nil unless index.base_dirs == @base_dirs
      index
    end
1273818
def get_yaml_dict(yaml_file):
    """"""
    try:
        with open(yaml_file, 'r') as file_:
            yaml_dict = yaml.safe_load(file_.read()) or {}
        return yaml_dict
    except FileNotFoundError:
        return {}
776932
def yaml_load(path, input="", err_quit=False):
    
    try:
        if len(input) > 0:
            return yaml.safe_load(input)
        elif len(path) > 0:
            return yaml.safe_load(file_to_string(path))
    except Exception as err:
        file = os.path.basename(path)
        ui.error("",
                 c.MESSAGES["yaml_error"].replace("%file", file), err,
                 "")

        if err_quit:
            sys.exit(1)

        return False
1358184
def to_yaml
      sorted_facts = @facts.sort.to_h
      facts_hash_with_expanded_values = Hash[sorted_facts.collect { |k, v| [k, v.value] }]
      YAML.dump(facts_hash_with_expanded_values)
    end
1022543
def _load_yaml_credentials(filename=None, yaml_key=None):
    
    try:
        with open(os.path.expanduser(filename)) as f:
            search_creds = yaml.safe_load(f)[yaml_key]
    except FileNotFoundError:
        logger.error("cannot read file {}".format(filename))
        search_creds = {}
    except KeyError:
        logger.error("{} is missing the provided key: {}"
                     .format(filename, yaml_key))
        search_creds = {}

    return search_creds
834081
function loadYaml (filename) {
    const file = findFile(`${filename}.yml`)
    return file ? YAML.parse(fs.readFileSync(file, 'utf8')) : {}
  }
878279
def read_fixture_files(path)
        yaml_files = Dir["#{path}/{**,*}/*.yml"].select { |f|
          ::File.file?(f)
        } + [yaml_file_path(path)]

        yaml_files.each_with_object({}) do |file, fixtures|
          FixtureSet::File.open(file) do |fh|
            self.model_class ||= fh.model_class if fh.model_class
            fh.each do |fixture_name, row|
              fixtures[fixture_name] = ActiveRecord::Fixture.new(row, model_class)
            end
          end
        end
      end
675056
def load_yaml_file(file_type, file_name)
      YAML.load_file file_name
    rescue StandardError => error
      @logger.error "Cannot load #{file_type}: #{file_name}"
      raise error
    end
754507
def load_hashes(filename):
    """"""
    # { filename : (sha1 of header if available or 'NA',
    #               sha1 of input,
    #               sha1 of output) }

    hashes = {}
    try:
        with open(filename, 'r') as cython_hash_file:
            for hash_record in cython_hash_file:
                (filename, header_hash,
                 cython_hash, gen_file_hash) = hash_record.split()
                hashes[filename] = (header_hash, cython_hash, gen_file_hash)
    except (KeyError, ValueError, AttributeError, IOError):
        hashes = {}
    return hashes
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
844088
def read_object_from_yaml(desired_type: Type[Any], file_object: TextIOBase, logger: Logger,
                          fix_imports: bool = True, errors: str = 'strict', *args, **kwargs) -> Any:
    
    return yaml.load(file_object)
440358
def load_yaml_from_docstring(docstring):
    """"""
    split_lines = trim_docstring(docstring).split("\n")

    # Cut YAML from rest of docstring
    for index, line in enumerate(split_lines):
        line = line.strip()
        if line.startswith("---"):
            cut_from = index
            break
    else:
        return {}

    yaml_string = "\n".join(split_lines[cut_from:])
    yaml_string = dedent(yaml_string)
    return yaml.safe_load(yaml_string) or {}
1245981
def parse_yaml_file(self, path):
        """"""
        with open(path, 'r') as fp:
            data = yaml.safe_load(fp)

        if not data:
            return {}

        def traverse(namespace, d):
            cfg = {}
            for key, val in d.items():
                if isinstance(d[key], dict):
                    cfg.update(traverse(namespace + [key], d[key]))
                else:
                    if not isinstance(val, str):
                        # All values should be double-quoted strings so they
                        # parse as strings; anything else is a configuration
                        # error at parse-time
                        raise ConfigurationError(
                            'Invalid value %r in file %s: values must be double-quoted strings' % (
                                val, path
                            )
                        )

                    cfg['_'.join(namespace + [key]).upper()] = val

            return cfg

        return traverse([], data)
676655
def load_yaml(filename):
    
    with open(filename) as f:
        ydoc = yaml.safe_load(f.read())
    return (ydoc, serialize_tojson(ydoc))
385336
def _load_yaml_file(yaml_file):
        
        with io.open(yaml_file, 'r', encoding='utf-8') as stream:
            yaml_content = yaml.load(stream)
            FileUtils._check_format(yaml_file, yaml_content)
            return yaml_content