Loads from file and caches all data from the config file in the form of an OrderedDict to self.data

        :param config_filepath: str, the full filepath to the config file
        :return: bool, success status
15942
def rebuild_config_cache(self, config_filepath):
        
        self.validate_config_file(config_filepath)
        config_data = None
        try:
            with open(config_filepath, 'r') as f:
                config_data = yaml.load(f)
            items = list(iteritems(config_data))

        except AttributeError:
            items = list(config_data)

        self.config_file_contents = OrderedDict(sorted(items, key=lambda x: x[0], reverse=True))
        self.config_filepath = config_filepath
804264
def load_requires_from_file(filepath):
    
    with open(filepath) as fp:
        return [pkg_name.strip() for pkg_name in fp.readlines()]
933145
def load(self, config_path=None):
        

        self._reset_config()

        if not config_path:
            config_path = os.path.join(
                appdirs.user_config_dir(self._app_name),
                self._config_file
            )

        try:
            # First check if it's file like. If it is, pyyaml can load it.
            # I'm checking type instead of catching exceptions to keep the
            # exception handling simple
            if hasattr(config_path, 'read'):
                config = yaml.safe_load(config_path)
            else:
                # If it isn't, it's a path. We have to open it first, otherwise
                # pyyaml will try to read it as yaml
                with open(config_path, 'rb') as config_file:
                    config = yaml.safe_load(config_file)
        except EnvironmentError:
            raise exceptions.ConfigNotFoundError('Couldn\'t read config at {config_path}'.format(
                config_path=str(config_path),
            ))
        except yaml.YAMLError:
            raise exceptions.ConfigSyntaxError('Error parsing YAML')

        if 'printer' in config:
            self._printer_config = config['printer']
            self._printer_name = self._printer_config.pop('type').title()

            if not self._printer_name or not hasattr(printer, self._printer_name):
                raise exceptions.ConfigSyntaxError(
                    'Printer type "{printer_name}" is invalid'.format(
                        printer_name=self._printer_name,
                    )
                )

        self._has_loaded = True
277086
def load_from_file(cls, file_path: str):
        
        with open(file_path, "r") as f:
            data = json.load(f)
            item = cls.decode(data=data)
        return item
929135
private static void loadFile(String filePath) {
        final Path path = FileSystems.getDefault().getPath(filePath);

        try {
            data.clear();
            data.load(Files.newBufferedReader(path));
        } catch(IOException e) {
            LOG.warn("Exception while loading " + path.toString(), e);
        }
    }
966750
def setup(self, filepath):
        
        if self.log is not None:
            self.log.warning("Disallowed multiple setup of config.")
            return

        self.log = logging.getLogger(__name__)
        self.parser = ConfigParser.RawConfigParser()
        self.parser.read(filepath)
        self.sections = self.parser.sections()
        self.log_output.append(
            {"level": "info", "msg": "Loading config-file (%s)" % filepath})
        self.load_config()
        self.handle_logging()
754963
def __load_all(self, config_filename):
        
        self._read_configuration_file(config_filename)
        self.connect()
        self.__find_source_files()
        self._get_column_type()
        self.__read_stored_routine_metadata()
        self.__get_constants()
        self._get_old_stored_routine_info()
        self._get_correct_sql_mode()
        self.__load_stored_routines()
        self._drop_obsolete_routines()
        self.__remove_obsolete_metadata()
        self.__write_stored_routine_metadata()
        self.disconnect()
443335
def from_file(filepath: str):
        
        trace = TrainingTrace()
        trace._trace = load_config(filepath)
        return trace
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
903832
def _load_from_file(metadata, load_func):
    
    config_filename = get_config_filename(metadata)
    if config_filename is None:
        return dict()

    with open(config_filename, "r") as file_:
        data = load_func(file_.read())
        return dict(data)
1079831
def load(cls, file_path):
        

        # convert back to numpy
        data = helper.read_json(file_path)
        return Concise.from_dict(data)
1164737
def load(cls, filepath):
        
        with open(filepath, "rb") as filehandler:
            classifier = pickle.load(filehandler)

        if not isinstance(classifier, Classifier):
            raise ValueError("Pickled object is not a Classifier")

        return classifier
860169
public static Object get(String filePath, String configKey)
    {
        if (propertiesMap.containsKey(filePath) == false)
        {
            loadProperty(filePath);
        }

        Properties properties = propertiesMap.get(filePath);
        if (properties == null)
        {
            return null;
        }

        Object resultConfig = properties.getProperty(configKey);
        return resultConfig;
    }
339455
private static Properties load(String configFilePath)
	{
		Properties props = new Properties();
		BufferedInputStream fis = null;
		try {
			File configFile = new File(configFilePath);
	        fis = new BufferedInputStream(new FileInputStream(configFile));
	        props.load(fis);
        }
        catch(IOException e){
        	System.err.println("Could not load configuration file "+configFilePath);
        }
        finally{
			if(fis!=null){
			    try {
					fis.close();
				}
				catch (IOException e) {
		        	System.err.println("Error closing file stream of configuration file "+configFilePath);
				}
			}
        }
        return props;
	}
586647
def load(self):
        
        data = self.dict_class()
        
        for path in self.paths:
            if path in self.paths_loaded: continue
            
            try:
                with open(path, 'r') as file:
                    path_data = yaml.load(file.read())
                    data = dict_merge(data, path_data)
                self.paths_loaded.add(path)
            except IOError:
                # TODO: Log this correctly once logging is implemented
                if not path.endswith('.local.yml'):
                    print 'CONFIG NOT FOUND: %s' % (path)

        self.data = data
1085246
function loadLegacyConfigFile(filePath) {
    debug(`Loading config file: ${filePath}`);

    // lazy load YAML to improve performance when not used
    const yaml = require("js-yaml");

    try {
        return yaml.safeLoad(stripComments(readFile(filePath))) || /* istanbul ignore next */ {};
    } catch (e) {
        debug(`Error reading YAML file: ${filePath}`);
        e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`;
        throw e;
    }
}
968277
def load_yaml(path):
    # type: (str) -> OrderedDict
    
    with open(path, 'rt') as f:
        yamldict = yaml.load(f.read(), Loader=yamlloader.ordereddict.CSafeLoader)
    if not yamldict:
        raise (LoadError('YAML file: %s is empty!' % path))
    return yamldict