Loads a YAML configuration file.
970486
def load_config(config_file)
      if dir_exists?
        begin
          config_file = File.join(config_dir, "#{config_file}.yml")
          config = YAML::load(File.open(config_file))

        rescue StandardError => e
          raise FileAccessError, e.message
        end
      else
        raise ConfigDirMissingError, 'Config dir missing. Run init command'
      end
    end
170594
def _import_yaml(config_file_path):
    
    try:
        logger.info('Importing config %s...', config_file_path)
        with open(config_file_path) as config_file:
            return yaml.safe_load(config_file.read())
    except IOError as ex:
        raise RepexError('{0}: {1} ({2})'.format(
            ERRORS['config_file_not_found'], config_file_path, ex))
    except (yaml.parser.ParserError, yaml.scanner.ScannerError) as ex:
        raise RepexError('{0} ({1})'.format(ERRORS['invalid_yaml'], ex))
658249
def load(self, filename):
        

        self._set_filename(filename)

        if os.path.isfile(self['location']):
            # d = OrderedDict(read_yaml_config(self['location'], check=True))
            d = read_yaml_config(self['location'], check=True)
            with open(self['location']) as myfile:
                document = myfile.read()
            x = yaml.load(document, Loader=yaml.FullLoader)
            try:
                self.update(d)
            except:
                print("ERROR: can not find", self["location"])
                sys.exit()
        else:
            print(
                "Error while reading and updating the configuration file {:}".format(
                    filename))
676655
def load_yaml(filename):
    
    with open(filename) as f:
        ydoc = yaml.safe_load(f.read())
    return (ydoc, serialize_tojson(ydoc))
659093
def load_extended_config_yaml
      Dir.glob("#{ENV['HOME']}/.ftl/templates/*.yml").each do |file|
        yaml = YAML.load_file(file)
        name = File.basename(file).gsub(".yml", '')
        @options[:templates][name.to_sym]=@options[:templates][:defaults]
        @options[:templates][name.to_sym].merge!(yaml)
      end
    end
386329
def load(filename):
    
    yaml_filename = os.path.join(os.path.dirname(filename), 'step.yaml')
    with open(yaml_filename) as f:
        return yaml.load(f)
220891
def _read_yaml_file(self, yaml_file):
        # type: (CliContext, pathlib.Path) -> None
        
        with yaml_file.open('r') as f:
            if self.config is None:
                self.config = ruamel.yaml.load(
                    f, Loader=ruamel.yaml.RoundTripLoader)
            else:
                self.config = blobxfer.util.merge_dict(
                    ruamel.yaml.load(f, Loader=ruamel.yaml.RoundTripLoader),
                    self.config)
256195
public function loadConfigurationFile($file = null)
    {
        $file = $file ?: $this->findConfigurationFile();
        if (! file_exists($file))
            return;

        $this->config = $this->yaml->load($file);
    }
1046579
def setup_from_yamlfile(self, yamlfile, output_shell=False):
        
        self.logger.debug('Loading config from ' + yamlfile)
        with open(yamlfile, 'r') as yamlfd:
            yamlconfig = yaml.load(yamlfd)
            for instance in yamlconfig['Instances']:
                self.add_instance(instance['role'].upper(),
                                  instance,
                                  output_shell=output_shell)
            if 'Config' in yamlconfig.keys():
                self.logger.debug('Config found: ' + str(yamlconfig['Config']))
                self.config = yamlconfig['Config'].copy()
709439
def load_yamlf(fpath, encoding):
    
    with codecs.open(fpath, encoding=encoding) as f:
        return yaml.safe_load(f)
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
1259136
def load_configuration(self):
        """"""
        filename = os.path.join(os.path.dirname(__file__), 'templates/spline-loc.yml.j2')
        with open(filename) as handle:
            return Adapter(safe_load(handle)).configuration
1175536
def load_yaml(filename):
    """"""
    with open(filename) as myfile:
        content = myfile.read()
        if "win" in sys.platform:
            content = content.replace("\\", "/")
        return yaml.safe_load(content)
536446
def _load_yaml_config(self):
        
        try:
            config = self._read_config()
        except OSError as error:
            raise ValueError('Could not read configuration file: %s' % error)
        try:
            return yaml.safe_load(config)
        except yaml.YAMLError as error:
            message = '\n'.join(['    > %s' % line
                                 for line in str(error).split('\n')])
            sys.stderr.write('\n\n  Error in the configuration file:\n\n'
                             '{}\n\n'.format(message))
            sys.stderr.write('  Configuration should be a valid YAML file.\n')
            sys.stderr.write('  YAML format validation available at '
                             'http://yamllint.com\n')
            raise ValueError(error)
1247277
def load(file)
      if file.nil? || !File.exist?(file)
        raise "Can't open #{file}."
      end
      loader = ReVIEW::YAMLLoader.new
      merge_config(@config.deep_merge(loader.load_file(file)))
    end
1125744
def load!(path, environment = nil)
      require 'yaml'
      environment ||= Rails.env
      conf = YAML.load(File.new(path).read).with_indifferent_access[environment]
      load_configuration(conf)
    end
216471
def load_yaml(file):
    """"""
    if hasattr(yaml, "full_load"):
        return yaml.full_load(file)
    else:
        return yaml.load(file)