Load a CRMod configuration file

        Parameters
        ----------
        filename: string
            absolute or relative path to a crmod config.dat file
4758
def load_crmod_config(self, filename):
        
        with open(filename, 'r') as fid:
            nr_of_configs = int(fid.readline().strip())
            configs = np.loadtxt(fid)
            print('loaded configs:', configs.shape)
            if nr_of_configs != configs.shape[0]:
                raise Exception(
                    'indicated number of measurements does not equal ' +
                    'to actual number of measurements')
            ABMN = self._crmod_to_abmn(configs[:, 0:2])
            self.configs = ABMN
836943
def load_configs(self, filename):
        
        configs = np.loadtxt(filename)
        self.add_to_configs(configs)
650766
def _validated_config_filename(self, name):
        
        dir_name = self._make_config_dir()
        filename = os.path.join(dir_name, name.split(".json")[0] + ".json")
        return filename
1283442
def load_config_file(self, location):
        
        location = coerce_location(location)
        for configured_location, rotation_scheme, options in load_config_file(self.config_file, expand=False):
            if configured_location.match(location):
                logger.verbose("Loading configuration for %s ..", location)
                if rotation_scheme:
                    self.rotation_scheme = rotation_scheme
                for name, value in options.items():
                    if value:
                        setattr(self, name, value)
                # Create a new Location object based on the directory of the
                # given location and the execution context of the configured
                # location, because:
                #
                # 1. The directory of the configured location may be a filename
                #    pattern whereas we are interested in the expanded name.
                #
                # 2. The execution context of the given location may lack some
                #    details of the configured location.
                return Location(
                    context=configured_location.context,
                    directory=location.directory,
                )
        logger.verbose("No configuration found for %s.", location)
        return location
1284725
public void load(String filename) throws FileNotFoundException, SAXException, IOException, ParserConfigurationException {
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    loadMessages(builder.parse(new CSFileInputStream(filename)));
  }
1192497
def load(self, filename, *, metadata=None):
        
        with open(filename, "rt", encoding="utf-8") as file:
            text = file.read()
        self.parse(text, metadata=metadata, filename=filename)
620889
protected function loadConfiguration($fileName) {
        if (!is_file($fileName)) throw new StrutsConfigException('Configuration file not found: "'.$fileName.'"');

        // TODO: what about checking the search result?
        $content = file_get_contents($fileName);
        $search  = '<!DOCTYPE struts-config SYSTEM "struts-config.dtd">';
        $offset  = strpos($content, $search);
        $dtd     = str_replace('\\', '/', __DIR__.'/dtd/struts-config.dtd');
        $replace = '<!DOCTYPE struts-config SYSTEM "file:///'.$dtd.'">';
        $content = substr_replace($content, $replace, $offset, strlen($search));

        // Konfiguration parsen und validieren
        return new \SimpleXMLElement($content, LIBXML_DTDVALID|LIBXML_NONET);
    }
1024341
function loadConfig(filename) {
  //Does our consumer have a valid .mitto?
  var mittoObject = _loadMitto();
  //Is it in a valid format?
  mittoObject = _validateMitto(mittoObject);

  //Does our consumer's consumer have a config of 'filename'?
  var configObject = _findFile(filename);
  //Is it in a valid format as prescribed by our consumer's .mitto?
  return _validateConfig(configObject, mittoObject);
}
839293
public final void loadConfiguration(final String pDirName,
    final String pFileName) throws Exception {
    this.mngSettings.loadConfiguration(pDirName, pFileName);
    loadPropertiesBase(pDirName);
    loadSqlTables();
  }
1001591
def load(self, filename):
        
        dir_name = os.path.dirname(filename)
        mod_name = os.path.basename(filename).split('.')[0]
        self.filename = mod_name
        sys.path.insert(0, dir_name)
        mod = __import__(mod_name)
        sys.path.remove(dir_name) # do not pollute the path.
        pipers, xtras, pipes = mod.pipeline()
        self.add_pipers(pipers, xtras)
        self.add_pipes(pipes)
1113511
def from_file(cls, filename, **kwargs):
        
        filename = os.path.expanduser(filename)
        if not os.path.isfile(filename):
            raise exceptions.PyKubeError("Configuration file {} not found".format(filename))
        with open(filename) as f:
            doc = yaml.safe_load(f.read())
        self = cls(doc, **kwargs)
        self.filename = filename
        return self
1003998
def load_data(self, filename):
        
        with zopen(filename, "rt") as f:
            self._data = json.load(f, cls=MontyDecoder)
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)
919084
def load(self, filename):
        ''' 
        '''
        if not os.path.exists(filename):
            #print 'Could not load config file [%s]' % (filename)
            raise AppConfigValueException('Could not load config file {0}'.
                    format(filename))
        cfl = open(filename, 'r')
        if PY2:
            self.readfp(cfl)
        else:
            self.read_file(cfl)
        cfl.close()
1333945
def _write_crmod_file(filename):
    
    crmod_lines = [
        '***FILES***',
        '../grid/elem.dat',
        '../grid/elec.dat',
        '../rho/rho.dat',
        '../config/config.dat',
        'F                ! potentials ?',
        '../mod/pot/pot.dat',
        'T                ! measurements ?',
        '../mod/volt.dat',
        'F               ! sensitivities ?',
        '../mod/sens/sens.dat',
        'F                ! another dataset ?',
        '1                ! 2D (=0) or 2.5D (=1)',
        'F                ! fictitious sink ?',
        '1660             ! fictitious sink node number',
        'F                ! boundary values ?',
        'boundary.dat',
    ]

    with open(filename, 'w') as fid:
        [fid.write(line + '\n') for line in crmod_lines]
102711
def load_configuration(yaml: yaml.ruamel.yaml.YAML, filename: str) -> DictLike:
    
    with open(filename, "r") as f:
        config = yaml.load(f)

    return config
580739
def read_config_file(filename)
      contents = ""
      File.open(filename, "r") { |f| contents = f.read() } if File.exists?(filename)
      contents
    end