Load config from yaml file or string

        :type config_file: str
        :rtype: dict

        :param config_file: config to load. Can be file path or yaml string
        :return: Loaded config
969571
def _load_yaml(self, config_file):
        
        try:
            with open(config_file) as f:
                return yaml.safe_load(f.read())
        except yaml.YAMLError as exc:
            logger.error("Could not parse config as YAML: {}", str(exc))
            if hasattr(exc, 'problem_mark'):
                mark = exc.problem_mark
                logger.error("Error position: (%s:%s)" % (mark.line + 1, mark.column + 1))
        except IOError as e:
            logger.debug("Could not open config file: {}", str(e))

        return None
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
133280
def load(config_path: str):
    
    # we bind the config to _ to keep it alive
    if os.path.splitext(config_path)[1] in ('.yaml', '.yml'):
        _ = load_yaml_configuration(config_path, translator=PipelineTranslator())
    elif os.path.splitext(config_path)[1] == '.py':
        _ = load_python_configuration(config_path)
    else:
        raise ValueError('Unknown configuration extension: %r' % os.path.splitext(config_path)[1])
    yield
282408
def load_configuration(self) -> None:
        
        config_file = self.default_config_file
        if self.config_file:
            config_file = self.config_file
        self.config = ConfigParser()
        self.config.read(config_file)
1190747
def _get_config(config_file):
    ''''''
    parser = ConfigParser.SafeConfigParser()
    if os.path.lexists(config_file):
        try:
            log.info('Reading config: %s', config_file)
            inp = open(config_file)
            parser.readfp(inp)
            return parser
        except (IOError, ConfigParser.ParsingError), err:
            raise ConfigError("Failed to read configuration %s\n%s" % (config_file, err))
    return None
130856
def load_yaml(yaml_file: str) -> Any:
    
    with open(yaml_file, 'r') as file:
        return ruamel.yaml.load(file, ruamel.yaml.RoundTripLoader)
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
838268
def _load_config(config_filepath: str) -> Dict[str, Any]:
        
        try:
            config: Dict[str, Any] = yaml.load(stream=open(config_filepath, "r"))
        except Exception as e:
            raise Exception(f"Invalid DAG Factory config file; err: {e}")
        return config
773746
def _load_config(self, path):
        
        try:
            with open(path) as f:
                values = yaml.safe_load(f)
                if isinstance(values, dict):
                    return values
                else:
                    raise yaml.YAMLError('Unable to parse/load {}'.format(path))
        except(IOError, yaml.YAMLError) as e:
            if self.ignore_errors:
                return None
            else:
                raise e
14994
def load_configuration(conf_path):
    
    with open(conf_path) as f:
        conf_dict = yaml.load(f)
    validate_config(conf_dict)
    return conf_dict
24683
def load_config path
      return {} unless File.exist? path
      YAML.load File.read path
    end
758336
def load_config(config_file):
    
    with open(config_file) as in_handle:
        config = yaml.safe_load(in_handle)
    config = _expand_paths(config)
    if 'resources' not in config:
        config['resources'] = {}
    # lowercase resource names, the preferred way to specify, for back-compatibility
    newr = {}
    for k, v in config["resources"].items():
        if k.lower() != k:
            newr[k.lower()] = v
    config["resources"].update(newr)
    return config
460235
def load(self, file=CONFIG_FILE):
        
        if not os.path.exists(file):
            print("Config file was not found under %s. Default file has been created" % CONFIG_FILE)
            self._settings = yaml.load(DEFAULT_CONFIG, yaml.RoundTripLoader)
            self.save(file)
            sys.exit()
        with open(file, 'r') as f:
            self._settings = yaml.load(f, yaml.RoundTripLoader)
45845
def from_yaml():
    
    default_yaml_str = snippets.get_snippet_content('hatchery.yml')
    ret = yaml.load(default_yaml_str, Loader=yaml.RoundTripLoader)
    for config_path in CONFIG_LOCATIONS:
        config_path = os.path.expanduser(config_path)
        if os.path.isfile(config_path):
            with open(config_path) as config_file:
                config_dict = yaml.load(config_file, Loader=yaml.RoundTripLoader)
                if config_dict is None:
                    continue
                for k, v in config_dict.items():
                    if k not in ret.keys():
                        raise ConfigError(
                            'found garbage key "{}" in {}'.format(k, config_path)
                        )
                    ret[k] = v
    return ret
1088090
def load_yaml_file(yaml_file):
    
    with io.open(yaml_file, 'r', encoding='utf-8') as stream:
        yaml_content = yaml.load(stream)
        _check_format(yaml_file, yaml_content)
        return yaml_content
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
980892
def _load_yaml_config(cls, config_data, filename="(unknown)"):
        """"""

        try:
            config = yaml.safe_load(config_data)
        except yaml.YAMLError as err:
            if hasattr(err, 'problem_mark'):
                mark = err.problem_mark
                errmsg = ("Invalid YAML syntax in Configuration file "
                          "%(file)s at line: %(line)s, column: %(column)s."
                          % dict(file=filename,
                                 line=mark.line + 1,
                                 column=mark.column + 1))
            else:
                errmsg = ("YAML error reading Configuration file "
                          "%(file)s"
                          % dict(file=filename))
            logger.error(errmsg)
            raise

        logger.info("Configuration: %s", config)
        return config