Return configuration files.
172470
def _configuration(self, *args, **kwargs):
        '''
        
        '''

        data = dict()
        self.db.open()
        for pkg in self.db.get(Package):
            configs = list()
            for pkg_cfg in self.db.get(PackageCfgFile, eq={'pkgid': pkg.id}):
                configs.append(pkg_cfg.path)
            data[pkg.name] = configs

        if not data:
            raise InspectorQueryException("No inspected configuration yet available.")

        return data
323923
def _load_configuration():
    """"""
    config = configparser.RawConfigParser()
    module_dir = os.path.dirname(sys.modules[__name__].__file__)
    if 'APPDATA' in os.environ:  # Windows
        os_config_path = os.environ['APPDATA']
    elif 'XDG_CONFIG_HOME' in os.environ:  # Modern Linux
        os_config_path = os.environ['XDG_CONFIG_HOME']
    elif 'HOME' in os.environ:  # Legacy Linux
        os_config_path = os.path.join(os.environ['HOME'], '.config')
    else:
        os_config_path = None
    locations = [os.path.join(module_dir, 'praw.ini'), 'praw.ini']
    if os_config_path is not None:
        locations.insert(1, os.path.join(os_config_path, 'praw.ini'))
    if not config.read(locations):
        raise Exception('Could not find config file in any of: {0}'
                        .format(locations))
    return config
809633
def get_config(config_file):
    """"""
    def load(fp):
        try:
            return yaml.safe_load(fp)
        except yaml.YAMLError as e:
            sys.stderr.write(text_type(e))
            sys.exit(1)  # TODO document exit codes

    if config_file == '-':
        return load(sys.stdin)
    if not os.path.exists(config_file):
        sys.stderr.write('ERROR: Must either run next to config.yaml or'
            ' specify a config file.\n' + __doc__)
        sys.exit(2)
    with open(config_file) as fp:
        return load(fp)
160544
def configured_options(self):
        """"""
        stdout_lines = self._check_output(['config', '--list']).splitlines()
        return {key: value for key, value in [line.split('=') for line in stdout_lines]}
273576
def get_files(dir_name):
    """"""
    return [(os.path.join('.', d), [os.path.join(d, f) for f in files]) for d, _, files in os.walk(dir_name)]
1222711
def _get_project_conf():
    """"""
    config_settings = {}

    project_root = find_vcs_root(".")
    if project_root is None:
        return config_settings

    for conf_dir in PROJECT_CONF_DIRS:
        conf_dir = conf_dir.lstrip("./")
        joined_dir = os.path.join(project_root, conf_dir) if conf_dir else project_root
        joined_glob = os.path.join(joined_dir, PROJECT_CONF)
        conf_files = glob.glob(joined_glob)
        # config files found, not trying other directories
        if conf_files:
            break
    else:
        conf_files = []

    for conf_file in conf_files:
        try:
            with io.open(conf_file, encoding="utf-8") as input_file:
                loaded_settings = yaml.safe_load(input_file)
        except EnvironmentError:
            logger.warning("Failed to load config from %s", conf_file)
        else:
            logger.info("Config loaded from %s", conf_file)
            config_settings.update(loaded_settings)

    return config_settings
1217397
def load_configuration(configuration):
    """"""
    if isinstance(configuration, dict):
        return configuration
    else:
        with open(configuration) as configfile:
            return json.load(configfile)
466030
def read_config(self):
        """"""
        config_file = os.path.join(self.config_dir, 'pueue.ini')
        self.config = configparser.ConfigParser()
        # Try to get configuration file and return it
        # If this doesn't work, a new default config file will be created
        if os.path.exists(config_file):
            try:
                self.config.read(config_file)
                return
            except Exception:
                self.logger.error('Error while parsing config file. Deleting old config')
                self.logger.exception()

        self.config['default'] = {
            'resumeAfterStart': False,
            'maxProcesses': 1,
            'customShell': 'default',
        }
        self.config['log'] = {
            'logTime': 60*60*24*14,
        }
        self.write_config()
586608
def get_config(config_spec):
        """"""
        config_file = None
        if config_spec.startswith("http"):
            # URL: fetch it
            config_file = urllib.urlopen(config_spec)
        else:
            # string: open file with that name
            config_file = open(config_spec)
        config = json.load(config_file)
        # Close any open files
        try:
            config_file.close()
        except:
            pass
        return config
185465
function getFiles () {
  const FUCK_ENV = process.env.FUCK_ENV
    || process.env.npm_package_config_FUCK_ENV
    || FUCK_ENV_DEFAULT
  return FUCK_ENV.split(',').map(file => path.resolve(root, file))
}
1250959
def files(self):
        """"""
        if self._rundir['ls'] is UNDETERMINED:
            out_stem = pathlib.Path(self.par['ioin']['output_file_stem'] + '_')
            out_dir = self.path / out_stem.parent
            if out_dir.is_dir():
                self._rundir['ls'] = set(out_dir.iterdir())
            else:
                self._rundir['ls'] = set()
        return self._rundir['ls']
531945
def load_config(files=None, root_path=None, local_path=None):
    """"""

    config = cfg.ConfigOpts()
    config.register_opts([
        cfg.Opt('root_path', default=root_path),
        cfg.Opt('local_path', default=local_path),
    ])
    # XXX register actual config groups here
    # theme_group = config_theme.register_config(config)
    if files is not None:
        config(args=[], default_config_files=files)
    return config
234741
def config(env=DEFAULT_ENV, default='locmem://'):
    """"""
    config = {}

    s = os.environ.get(env, default)

    if s:
        config = parse(s)

    return config
123361
def get_settings():
    '''
    
    '''
    settings = {}
    for config_file in config_files():
        config_contents = load_config(config_file)
        if config_contents is not None:
            settings = deep_merge(settings, config_contents)
    return settings
297312
def get_registered_configs(self, instances=None):
        
        configs = self.state.get('config_files', {})
        if instances is not None:
            for config_file, config in configs.items():
                if config['instance_name'] not in instances:
                    configs.pop(config_file)
        return configs
786930
def get_config(basedir, files):
    
    config_details = config.find(
        basedir, files,
        environment.Environment.from_env_file(basedir))

    return config.load(config_details)
1089085
def get_conf_d_files(path):
    
    if not os.path.isdir(path):
        raise ValueError("'%s' is not a directory" % path)
    files_mask = os.path.join(path, "*.conf")
    return [f for f in sorted(glob.glob(files_mask)) if os.path.isfile(f)]