Setup the actual class.

        :param str filepath: path to the config-file (including file-name)
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()
531549
public function loadPlugin(string $filePath, string $configPath)
    {
        $plugin = (new PluginManager($this, $filePath, new ClassLoader()))->load($configPath);

        $this->instance('wp.plugin.'.$plugin->getHeader('plugin_id'), $plugin);

        return $plugin;
    }
13249
def save(self, filepath):
        

        if not filepath or not isinstance(filepath, str):
            raise ValueError("Invalid filepath")

        with open(filepath, "wb") as filehandler:
            pickle.dump(self, filehandler)
1273951
def init_default(self):
        
        import f311
        if self.default_filename is None:
            raise RuntimeError("Class '{}' has no default filename".format(self.__class__.__name__))
        fullpath = f311.get_default_data_path(self.default_filename, class_=self.__class__)
        self.load(fullpath)
        self.filename = None
337301
def add_filepath(self, manifest, filepath, fullpath, copy=False):
        
        filepath = os.path.normpath(filepath)
        if self.manifests[manifest].add_filepath(filepath, fullpath, copy):
            # Only link if filepath was added
            self.manifests[manifest].make_link(filepath)
710486
private void setClassPath() throws IOException {
    String fullPath = file.getAbsolutePath();
    String rootPath = fullPath.substring(0, fullPath.lastIndexOf(classFile.getRelativePath()));
    List<File> classPath = new ArrayList<>();
    classPath.add(new File(rootPath));
    parserEnv.fileManager().setLocation(StandardLocation.CLASS_PATH, classPath);
  }
301673
@ConfigArg(0)
  public void setPath(PathImpl path)
  {
    _classDir = path;

    if (_sourceDir == null) {
      _sourceDir = path;
    }
  }
804156
public static void setInitFilePath(String filePath) {
		filePath=getPropertiesFilePath(filePath);
		
		if (staticFileProperties == null) {
			staticFileProperties=new FileProperties(filePath);
		} else {
			staticFileProperties.setInitFilePath(filePath);
		}
	}
385803
def create_setup_cfg(self, path):  # type: (str) -> None
        
        source = """[metadata]
name = {0}
version=0.0.1 
""".format(
            self.project
        )
        with io.open(path, "w", encoding="utf-8") as outfile:
            outfile.write(source)
510631
def read_file(cls, filepath):
        
        with open(filepath, mode='rb') as f:
            contents = f.read()
        return cls.decode(contents)
576174
public function save($filePath = null) {
		
		// Determine the correct file path.
		$filePath = ($filePath == null) ? $this->configFilePath : $filePath;
		
		// Store the file
		file_put_contents ( $filePath, $this->getConfigFileText () );
	}
1328396
def _load(self, file_path: Text) -> None:
        

        # noinspection PyUnresolvedReferences
        module_ = types.ModuleType('settings')
        module_.__file__ = file_path

        try:
            with open(file_path, encoding='utf-8') as f:
                exec(compile(f.read(), file_path, 'exec'), module_.__dict__)
        except IOError as e:
            e.strerror = 'Unable to load configuration file ({})'\
                .format(e.strerror)
            raise

        for key in dir(module_):
            if CONFIG_ATTR.match(key):
                self[key] = getattr(module_, key)
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
518968
def _loadfilepath(self, filepath, **kwargs):
        
        with open(filepath, "r") as f:
            data = json.load(f, **kwargs)
        return data
745032
public static function setupFromFile($filePath) {

        $loggers = null;

        require($filePath);

        if (!isset($loggers)) {
            throw new LoggerManagerException('The configuration file [' . $filePath . '] must define a variable $loggers');
        }

        if (!is_array($loggers)) {
            throw new LoggerManagerException('The configuration file [' . $filePath . '] must define a variable $loggers as an array');
        }

        self::setupFromArray($loggers);
    }
202067
def save_to_file(self, filename: str) -> ConfigFile:
        
        newclass = ConfigFile(fd=filename, load_hook=self.normal_class_hook[0],
                              dump_hook=self.normal_class_hook[1], safe_load=self.safe_load)
        return newclass
1001053
def load(self, filepath, file_encoding=None):
        
        with open(filepath, encoding=file_encoding) as inf:
            for line in inf:
                current_line = str(line).strip()
                if current_line.startswith("@prefix"):
                    self._add_ttl_ns(current_line.replace("\n",""))
                elif len(current_line) > 10:
                    break
        self.__make_dicts__