Loads config file

    Parameters
    ----------
    filename: str
        Filename of config file (incl. file extension
    filepath: str
        Absolute path to directory of desired config file
497282
def load_config(filename, filepath=''):
    

    FILE = path.join(filepath, filename)

    try:
        cfg.read(FILE)
        global _loaded
        _loaded = True
    except:
        print("configfile not found.")
475648
def _loadConfiguration(self):
        
        configPath = os.path.join(self.path, "config")
        if not os.path.isdir(configPath):
            return

        config = Config(configPath)

        Config.mergeDictionaries(config.getData(), self.application.config)
316097
def load_config(path)
      return unless File.exist?(path)
      buf = File.read(path) 
      eval("#{buf}", binding, path)
    end
207303
def load_file(self, filename):
        
        if not path.exists(filename):
            raise FileNotFoundError(filename)

        loaded_yaml = load_yaml(filename, self.context)
        if loaded_yaml:
            self.merge(loaded_yaml)
518968
def _loadfilepath(self, filepath, **kwargs):
        
        with open(filepath, "r") as f:
            data = json.load(f, **kwargs)
        return data
493339
def load_configuration(self, configuration_file):
        '''
        '''
        if os.path.isfile(configuration_file):
            if not isinstance(configuration_file, tb.file.File) and os.path.splitext(configuration_file)[1].strip().lower() != ".h5":
                load_configuration_from_text_file(self, configuration_file)
            else:
                load_configuration_from_hdf5(self, configuration_file)
        else:
            raise ValueError('Cannot find configuration file specified: %s' % configuration_file)
1245527
def reformat_filepath(self, config_file, filename):
        
        if not filename.startswith("/"):
            filename = self.config_file_format.format(config_file, filename)
        return filename
261958
def load_config_file(config_path)
      abort "Can not find config file at #{config_path}" if !File.readable?(config_path)
      config = File.read(config_path)
      # trim off anything after __END__
      config.sub!(/^__END__\n.*/, '')
      @app.module_eval(config)
    end
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()
1217768
def read_config(
        config_filepath,
        logger=logging.getLogger('ProsperCommon'),
):
    
    config_parser = configparser.ConfigParser(
        interpolation=ExtendedInterpolation(),
        allow_no_value=True,
        delimiters=('='),
        inline_comment_prefixes=('#')
    )
    logger.debug('config_filepath=%s', config_filepath)

    with open(config_filepath, 'r') as filehandle:
        config_parser.read_file(filehandle)

    return config_parser
400656
def load(self, filename):
        
        # print ("LOAD CONFIGDICT", filename)

        self.data = BaseConfigDict(filename=Config.path_expand(filename))
        try:
            version = str(self.data["meta"]["version"])
            if version not in self.versions:
                Console.error("The yaml file version must be {}".format(
                    ', '.join(self.versions)))
                sys.exit(1)
        except Exception as e:
            Console.error(
                "Your yaml file ~/.cloudmesh/cloudmesh.yaml is not up to date.",
                traceflag=False)
            Console.error(e.message, traceflag=False)
            sys.exit(1)
994002
def loadFile(self, fileName):
        
        self.fileName = fileName
        self.qteWeb.load(QtCore.QUrl(fileName))
173508
def load_config(path):
    
    path = os.path.abspath(path)
    if os.path.isdir(path):
        config, wordlists = _load_data(path)
    elif os.path.isfile(path):
        config = _load_config(path)
        wordlists = {}
    else:
        raise InitializationError('File or directory not found: {0}'.format(path))
    for name, wordlist in wordlists.items():
        if name in config:
            raise InitializationError("Conflict: list {!r} is defined both in config "
                                      "and in *.txt file. If it's a {!r} list, "
                                      "you should remove it from config."
                                      .format(name, _CONF.TYPE.WORDS))
        config[name] = wordlist
    return config
1203558
def fetch_config(filename):
    

    #  This trick gets the directory of *this* file Configuration.py thus
    # allowing to find the schema files relative to this file.
    dir_name = get_source_dir()

    # Append json
    filename = os.path.join('json', filename)

    fileobj = open(os.path.join(dir_name, filename), 'r')
    my_dict = json.loads(fileobj.read())
    return my_dict
905380
def load_config(filename=None):
    
    try:
        with _config_stream(filename) as handle:
            filename = handle.name
            return deserialize_config(handle.read())
    except (OSError, toml.TomlDecodeError, UnicodeDecodeError) as exc:
        raise ConfigError(
            'Error loading configuration from {}'.format(filename)) from exc
493776
def load_toml_path_config(filename):
    
    if not os.path.exists(filename):
        LOGGER.info(
            "Skipping path loading from non-existent config file: %s",
            filename)
        return PathConfig()

    LOGGER.info("Loading path information from config: %s", filename)

    try:
        with open(filename) as fd:
            raw_config = fd.read()
    except IOError as e:
        raise LocalConfigurationError(
            "Unable to load path configuration file: {}".format(str(e)))

    toml_config = toml.loads(raw_config)

    invalid_keys = set(toml_config.keys()).difference(
        ['data_dir', 'key_dir', 'log_dir', 'policy_dir'])
    if invalid_keys:
        raise LocalConfigurationError("Invalid keys in path config: {}".format(
            ", ".join(sorted(list(invalid_keys)))))

    config = PathConfig(
        config_dir=None,
        data_dir=toml_config.get('data_dir', None),
        key_dir=toml_config.get('key_dir', None),
        log_dir=toml_config.get('log_dir', None),
        policy_dir=toml_config.get('policy_dir', None)
    )

    return config
515856
def load(self, filepath):
        
        try:
            self._config.read(filepath)
            self.long_running_operation_timeout = self._config.getint(
                "Azure", "long_running_operation_timeout")
        except (ValueError, EnvironmentError, NoOptionError):
            msg = "Supplied config file incompatible"
            raise_with_traceback(ValueError, msg)
        finally:
            self._clear_config()
        return super(AzureConfiguration, self).load(filepath)