Default configuration package structure
323117
public function makeDefaultPackageStructure()
    {
        $default = $this->config->get('tie.stubs.default');
        if (!blank($default)) {
            foreach ($default as $stubKey) {
                $this->stubKey = $stubKey;
                $configuration = $this->config->get('tie.stubs.structure.' . $stubKey);
                if (is_array($configuration)) {
                    $this->createStubFiles($configuration);
                } else {
                    $this->makeDir($this->path . '/' . $configuration);
                }
            }
        }
    }
1304098
def _add_defaults_python(self):
        """"""
        if self.distribution.has_pure_modules():
            build_py = self.get_finalized_command('build_py')
            self.filelist.extend(build_py.get_source_files())
            # This functionality is incompatible with include_package_data, and
            # will in fact create an infinite recursion if include_package_data
            # is True.  Use of include_package_data will imply that
            # distutils-style automatic handling of package_data is disabled
            if not self.distribution.include_package_data:
                for _, src_dir, _, filenames in build_py.data_files:
                    self.filelist.extend([os.path.join(src_dir, filename)
                                          for filename in filenames])
1182044
def default(cls, package):
        
        partname = PackURI('/word/styles.xml')
        content_type = CT.WML_STYLES
        element = parse_xml(cls._default_styles_xml())
        return cls(partname, content_type, element, package)
854001
function getConfigSettings(packageJsonFile) {
  // Locate and read package.json
  const pkg = JSON.parse(fs.readFileSync(packageJsonFile));

  return {
    searchDir:
      getConfigSetting(pkg, 'searchDir', true) || getDefaultValue('searchDir'),
    outputFile:
      getConfigSetting(pkg, 'outputFile') || getDefaultValue('outputFile'),
    pattern: getConfigSetting(pkg, 'pattern') || getDefaultValue('pattern'),
  };
}
471696
private function setDefaultConfiguration(): void
    {
        $this->parameterBag->set('app.devmode', false);
        $this->parameterBag->set('container.dumper.inline_class_loader', true);

        $this->config->addPass($this->parameterBag);
    }
693888
def get_default_config(self):
        
        config = super(SlonyCollector, self).get_default_config()
        config.update({
            'path': 'postgres',
            'host': 'localhost',
            'user': 'postgres',
            'password': 'postgres',
            'port': 5432,
            'slony_node_string': 'Node [0-9]+ - postgres@localhost',
            'method': 'Threaded',
            'instances': {},
        })
        return config
232484
protected function mergePackageConfiguration()
    {
        $defaultConfig = require self::CONFIG_PATH;
        $currentConfig = $this->config->get('redis-sentinel', [ ]);

        $this->packageConfig = array_merge($defaultConfig, $currentConfig);
    }
1157406
def list_config(root_package = 'vlcp'):
    '''
    
    '''
    pkg = __import__(root_package, fromlist=['_'])
    return_dict = OrderedDict()
    for imp, module, _ in walk_packages(pkg.__path__, root_package + '.'):
        m = __import__(module, fromlist = ['_'])
        for name, v in vars(m).items():
            if v is not None and isinstance(v, type) and issubclass(v, Configurable) \
                    and v is not Configurable \
                    and hasattr(v, '__dict__') and 'configkey' in v.__dict__ \
                    and v.__module__ == module:
                configkey = v.__dict__['configkey']
                if configkey not in return_dict:
                    configs = OrderedDict()
                    v2 = v
                    parents = [v2]
                    while True:
                        parent = None
                        for c in v2.__bases__:
                            if issubclass(c, Configurable):
                                parent = c
                        if parent is None or parent is Configurable:
                            break
                        if hasattr(parent, '__dict__') and 'configkey' not in parent.__dict__:
                            parents.append(parent)
                            v2 = parent
                        else:
                            break
                    for v2 in reversed(parents):
                        tmp_configs = {}
                        for k, default_value in v2.__dict__.items():
                            if k.startswith('_default_'):
                                config_attr = k[len('_default_'):]
                                if config_attr in v.__dict__:
                                    continue
                                configname = configkey + '.' + config_attr
                                tmp_configs.setdefault(configname, OrderedDict())['default'] = \
                                    pformat(default_value, width=10)
                        # Inspect the source lines to find remarks for these configurations
                        lines, _ = getsourcelines(v2)
                        last_remark = []
                        for l in lines:
                            l = l.strip()
                            if not l:
                                continue
                            if l.startswith('#'):
                                last_remark.append(l[1:])
                            else:
                                if l.startswith('_default_'):
                                    key, sep, _ = l.partition('=')
                                    if sep and key.startswith('_default_'):
                                        configname = configkey + '.' +  key[len('_default_'):].strip()
                                        if configname in tmp_configs and configname not in configs:
                                            configs[configname] = tmp_configs.pop(configname)
                                        if configname in configs and last_remark:
                                            configs[configname]['description'] = cleandoc('\n' + '\n'.join(last_remark))
                                del last_remark[:]
                        for key in tmp_configs:
                            if key not in configs:
                                configs[key] = tmp_configs[key]
                    if configs:
                        return_dict[configkey] = OrderedDict((('class', v.__module__ + '.' + name),
                                                             ('classdescription', getdoc(v)),
                                                             ('configs', configs)))
    return return_dict
1033933
def load_package(package_dir, package=None, exclude=None, default_section=_DEFAULT_SECTION):
    
    init_py = '__init__.py'
    py_ext = '.py'
    files = os.listdir(package_dir)
    if init_py in files:
        files = [f for f in files if f != init_py]
        if package:
            files.insert(0, package)

    def init_package(item):
        if str(item).endswith(py_ext):
            item = item[:-3]
            if package:
                item = '{package}.{item}'.format(package=package, item=item)
        elif _is_conf(item):
            item = '{package_dir}/{item}'.format(package_dir=package_dir, item=item)
        else:
            item = package
        return str(item)

    logger.debug(files)
    files = [init_package(f) for f in files]
    if exclude:
        files = [f for f in files if f not in exclude]

    settings = load(files, default_section)
    return merge(settings)
948855
def default(self):
        """"""
        import json

        import ambry.bundle.default_files as df
        import os

        path = os.path.join(os.path.dirname(df.__file__), 'notebook.ipynb')

        if six.PY2:
            with open(path, 'rb') as f:
                content_str = f.read()
        else:
            # py3
            with open(path, 'rt', encoding='utf-8') as f:
                content_str = f.read()

        c = json.loads(content_str)

        context = {
            'title': self._bundle.metadata.about.title,
            'summary': self._bundle.metadata.about.title,
            'bundle_vname': self._bundle.identity.vname
        }

        for cell in c['cells']:
            for i in range(len(cell['source'])):
                cell['source'][i] = cell['source'][i].format(**context)

        c['metadata']['ambry'] = {
            'identity': self._bundle.identity.dict
        }

        return json.dumps(c, indent=4)
1157498
protected static boolean loadDefaultConf(String packageName) throws ParseException {

      if (packageName.endsWith(".conf")) {
         return false;
      }

      packageName = packageName.replaceAll("\\$[0-9]+$", "");


      Resource defaultConf = new ClasspathResource((packageName.replaceAll("\\.",
                                                                           "/"
                                                                          ) + "/" + DEFAULT_CONFIG_FILE_NAME).trim(),
                                                   Config.getDefaultClassLoader()
      );

      // Go through each level of the package until we find one that
      // has a default properties file or we cannot go any further.
      while (!defaultConf.exists()) {
         int idx = packageName.lastIndexOf('.');
         if (idx == -1) {
            defaultConf = new ClasspathResource(packageName + "/" + DEFAULT_CONFIG_FILE_NAME,
                                                Config.getDefaultClassLoader()
            );
            break;
         }
         packageName = packageName.substring(0, idx);
         defaultConf = new ClasspathResource(packageName.replaceAll("\\.", "/") + "/" + DEFAULT_CONFIG_FILE_NAME,
                                             Config.getDefaultClassLoader()
         );
      }

      if (defaultConf.exists()) {
         loadConfig(defaultConf);
         return true;
      }


      return false;
   }
17376
function defaultStrategy(projectDir, builder, cb)
{
  const pkg = fs.realpathSync(INSTALLER_PACKAGE);
  builder.buildFromPackage(pkg, projectDir, cb);
}
335340
function getConfig(fpath, defaults) {
  var path = require('path');
  var dpath = path.dirname(path.resolve(fpath));

  function parentpath(fromdir, pattern) {
    var pp = require('parentpath'),
        cwd = process.cwd();
    try {
      process.chdir(fromdir);
      return pp.sync(pattern);
    } catch (e) {
      return null;
    } finally {
      process.chdir(cwd);
    }
  }

  function fromNpm() {
    var config;
    var dir = parentpath(dpath, 'package.json');
    if (dir) {
      try {
        config = require(dir + '/package.json')[MJS_NPM];
        config.__origin__ = dir + '/package.json';
      } catch (e) {
      }
    }
    return config;
  }

  function fromResourceFile() {
    var candidates = [
      parentpath(path, MJS_RC),
      process.env.HOME, process.env.USERPROFILE, process.env.HOMEPATH, process.env.HOMEDRIVE + process.env.HOMEPATH
    ];

    var config;
    for (var i = 0; i < candidates.length; i++) {
      var candidate = candidates[i] + '/' + MJS_RC;
      if (fs.existsSync(candidate)) {
        try {
          config = JSON.parse(fs.readFileSync(candidate));
          config.__origin__ = candidate;
          break;
        } catch (e) {
          showHelpAndExit('Unable to read config from "' + candidate + '": ' + e.message, 1);
        }
      }
    }
    return config;
  }

  var config = fromNpm() || fromResourceFile() || {};
  // Make sure we apply defaults to missing values
  Object.keys(defaults).filter(function (k) {
    return config[k] == null
  }).forEach(function (k) {
    config[k] = defaults[k];
  });
  return config;
}
1163386
def _set_package_directory():
    

    package_directory = os.path.normpath(os.path.join(os.path.dirname(__file__), "../"))
    package_directory not in sys.path and sys.path.append(package_directory)
1288345
function getDefaultConfigPath () {
  let filePath
  let i
  let k

  for (k = 0; k < DEFAULT_CONFIG_DIRS.length; k++) {
    for (i = 0; i < SUPPORTED_EXTENSIONS.length; i++) {
      filePath = DEFAULT_CONFIG_DIRS[k] + SUPPORTED_EXTENSIONS[i]
      if (fileUtils.fileExistsSync(filePath)) {
        return filePath
      }
    }
  }

  throw new Error('No config file found')
}
180455
def configuration(parent_package='', top_path=None):
    """"""
    config = Configuration('', parent_package, top_path)

    F95FLAGS = get_compiler_flags()

    kwargs = {
        'libraries': [],
        'include_dirs': [],
        'library_dirs': [],
    }
    kwargs['extra_compile_args'] = F95FLAGS
    kwargs['f2py_options'] = ['--quiet']

    # numpy.distutils.fcompiler.FCompiler doesn't support .F95 extension
    compiler = FCompiler(get_default_fcompiler())
    compiler.src_extensions.append('.F95')
    compiler.language_map['.F95'] = 'f90'

    # collect all Fortran sources
    files = os.listdir('src')
    exclude_sources = ['PlanetsConstants.f95', 'PythonWrapper.f95']
    sources = [os.path.join('src', file) for file in files if
               file.lower().endswith(('.f95', '.c')) and file not in
               exclude_sources]

    # (from http://stackoverflow.com/questions/14320220/
    #              testing-python-c-libraries-get-build-path)):
    build_lib_dir = "{dirname}.{platform}-{version[0]}.{version[1]}"
    dirparams = {'dirname': 'temp',
                 'platform': sysconfig.get_platform(),
                 'version': sys.version_info}
    libdir = os.path.join('build', build_lib_dir.format(**dirparams))
    print('searching SHTOOLS in:', libdir)

    # Fortran compilation
    config.add_library('SHTOOLS',
                       sources=sources,
                       **kwargs)

    # SHTOOLS
    kwargs['libraries'].extend(['SHTOOLS'])
    kwargs['include_dirs'].extend([libdir])
    kwargs['library_dirs'].extend([libdir])

    # FFTW info
    fftw_info = get_info('fftw', notfound_action=2)
    dict_append(kwargs, **fftw_info)

    if sys.platform != 'win32':
        kwargs['libraries'].extend(['m'])

    # BLAS / Lapack info
    lapack_info = get_info('lapack_opt', notfound_action=2)
    blas_info = get_info('blas_opt', notfound_action=2)
    dict_append(kwargs, **blas_info)
    dict_append(kwargs, **lapack_info)

    config.add_extension('pyshtools._SHTOOLS',
                         sources=['src/pyshtools.pyf',
                                  'src/PythonWrapper.f95'],
                         **kwargs)

    return config
536575
def init_config(self, app):
        
        app.config.setdefault('REQUIREJS_BASEURL', app.static_folder)
        app.config.setdefault('COLLECT_STATIC_ROOT', app.static_folder)
        app.config.setdefault('COLLECT_STORAGE', 'flask_collect.storage.link')
        app.config.setdefault(
            'COLLECT_FILTER', partial(collect_staticroot_removal, app))
        app.config.setdefault(
            'WEBPACKEXT_PROJECT', 'invenio_assets.webpack:project')