Load yaml-formatted config file.

        Parameters
        ----------
        path : str
            path to config file
329210
def load(self, path):
        
        with open(path) as f:
            self.config = full_load(f)
            if self.config is None:
                sys.stderr.write("Warning: config file is empty!\n")
                self.config = {}
1011613
def _load_yaml_config(path=None):
    """"""
    countour_yaml_path = path or find_contour_yaml()

    if countour_yaml_path is None:
        logging.debug("countour.yaml not found.")
        return None

    with open(countour_yaml_path) as yaml_file:
        return yaml_file.read()
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
1373658
def load
      @config = YAML.load_file(config_path)
      @status.set(errors: Status::INFO_FILE_LOADED)
      if @config == false
        @status.set(errors: Status::ERR_NOT_LOADING_EMPTY_FILE)
      end
    rescue
      @status.set(errors: Status::ERR_CANT_LOAD)
    end
157006
def load_config(cls, configfile="logging.yaml"):
        
        configfile = getenv(cls.CONFIGFILE_ENV_KEY, configfile)
        if isfile(configfile):
            with open(configfile, "r") as cf:
                # noinspection PyBroadException
                try:
                    dictConfig(load(cf))
                except ValueError:
                    debug("Learn to config foooo! Improper config at %s", configfile)
                except Exception:
                    exception("Something went wrong while reading %s.", configfile)
        else:
            raise ValueError("Invalid configfile specified: {}".format(configfile))
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
803855
def config_file(*paths)
      Dir.chdir(root || '.') do
        paths.each do |pattern|
          Dir.glob(pattern) do |file|
            raise UnsupportedConfigType unless ['.yml', '.erb'].include?(File.extname(file))
            logger.info "loading config file '#{file}'" if logging? && respond_to?(:logger)
            document = ERB.new(IO.read(file)).result
            yaml = YAML.load(document)
            config = config_for_env(yaml)
            config.each_pair { |key, value| set(key, value) }
          end
        end
      end
    end
233788
function loadYAMLConfig(configPath) {
  try {
    return safeLoad(readFileSync(configPath, 'utf8'))
  } catch (e) {
    if (e.constructor.name === 'YAMLException') {
      throw e
    }
    log.error({
      message: chalk.red(`Unable to find YML config at "${configPath}".`),
      ref: 'unable-to-find-config',
    })
    return undefined
  }
}
316097
def load_config(path)
      return unless File.exist?(path)
      buf = File.read(path) 
      eval("#{buf}", binding, path)
    end
1182424
def core__read_yaml(file_path)
      # return nil if file not exist
      return unless File.exist?(file_path)
      config_file = File.read(file_path)
      # return yaml data
      return YAML.safe_load(config_file).with_indifferent_access
    rescue
      nil
    end
937695
def load_config(paths=DEFAULT_CONFIG_PATHS):
    
    config = Config()
    for path in paths:
        if os.path.isfile(path):
            config.load_pyfile(path)

    return config
1057137
def _load_yaml_file(self, file):
        
        try:
            res = load_yaml_file(file)
        except:
            self.exception("Failed to load from {}".format(file))
            raise IOError("Loading file failed")
        return res
1303625
def load_yaml(data=None, path=None, name='NT'):
    
    if data and not path:
        return mapper(yaml.load(data), _nt_name=name)
    if path and not data:
        with open(path, 'r') as f:
            data = yaml.load(f)
        return mapper(data, _nt_name=name)
    if data and path:
        raise ValueError('expected one source and received two')
463926
def load_yaml_by_path(cls, path, log_debug=False):
        """"""
        try:
            if isinstance(path, six.string_types):
                return yaml.load(open(path, 'r'), Loader=Loader) or {}
            else:
                return yaml.load(path, Loader=Loader) or {}
        except (yaml.scanner.ScannerError, yaml.parser.ParserError) as e:
            log_level = logging.DEBUG if log_debug else logging.WARNING
            logger.log(log_level, 'Yaml error in {path} (line {ln}, column {col}): {err}'.
                       format(path=path,
                              ln=e.problem_mark.line,
                              col=e.problem_mark.column,
                              err=e.problem))
            return None
830079
def load_yaml(filename):
    
    try:
        with open(filename, 'rb') as f:
            return yaml.load(f, Loader=Loader)
    except (IOError, yaml.error.YAMLError) as exc:
        raise ConfigReadError(filename, exc)
181561
def load_config(configfile):
    
    try:
        with open(configfile, 'r') as ymlfile:
            try:
                config = yaml.load(ymlfile)
                return config
            except yaml.parser.ParserError:
                raise PyYAMLConfigError(
                    'Could not parse config file: {}'.format(configfile),
                )
    except IOError:
        raise PyYAMLConfigError(
            'Could not open config file: {}'.format(configfile),
        )
1226266
def load_conf(yml_file, conf={}):
    
    with open(yml_file) as f:
        data = yaml.load(f)
        if conf:
            data.update(conf)
        return dictdot(data)