Fetches the finished configuration for a given path. This will try to look for a specific value
 and fallback to a default value if nothing was found
974387
def fetch_value(path)
      specifics = @data['data'].select { |a| path.include?(a['filter']) }

      default = @data['default']

      values = default.clone
      specifics.each do |specific|
        values = values.fastlane_deep_merge(specific)
      end

      change_paths_to_absolutes!(values)
      validate_values(values)

      values
    end
991185
def _load_config(self, path):
        
        p = os.path.abspath(os.path.expanduser(path))
        logger.debug('Loading configuration from: %s', p)
        return read_json_file(p)
731002
function getPaths(path) {
        var appPath = path;
        if (/dev\/temp\.ts$/.test(path)) // hack used when debugging.
            appPath = 'pargv';
        var appName = path_1.basename(appPath); // get the basename from path.
        var completionsDir = path_1.join(env.HOME_PATH, "." + appName);
        if (/\.(ts|js)$/.test(appPath)) {
            appPath = "./" + appPath; // not installed as bin.
            var parsedPath = path_1.parse(appPath);
            completionsDir = parsedPath.dir; // store completions.sh at executable file path.
        }
        var bashPath = !/^win/.test(env.PLATFORM) ? /^darwin/.test(env.PLATFORM) ? '.bash_profile' : '.bashrc' : false;
        if (bashPath)
            bashPath = path_1.join(env.HOME_PATH, bashPath);
        var completionsPath = path_1.join(completionsDir, 'completions.sh');
        return {
            appName: appName,
            appPath: appPath,
            bashPath: bashPath,
            completionsDir: completionsDir,
            completionsPath: completionsPath // the completions path.
        };
    }
638843
public alluxio.grpc.ConfigProperties getPathConfigsOrDefault(
      java.lang.String key,
      alluxio.grpc.ConfigProperties defaultValue) {
    if (key == null) { throw new java.lang.NullPointerException(); }
    java.util.Map<java.lang.String, alluxio.grpc.ConfigProperties> map =
        internalGetPathConfigs().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
629299
def get(self, path):
        
        data = self.app.test_client().get("/%s" % path).data
        return data
711678
def _getconf(self, rscpath, logger=None, conf=None):
        

        result = None

        resource = self.pathresource(rscpath=rscpath, logger=logger)

        if resource is not None:

            for cname in self._cnames(resource=resource):

                category = Category(name=cname)

                if result is None:
                    result = Configuration()

                result += category

                for param in self._params(resource=resource, cname=cname):

                    if conf is not None:
                        confparam = None

                        if cname in conf and param.name in conf[cname]:
                            confparam = conf[cname][param.name]

                        else:
                            confparam = conf.param(pname=param.name)

                        if confparam is not None:
                            svalue = param.svalue

                            param.update(confparam)

                            if svalue is not None:
                                param.svalue = svalue
                                param.resolve()

                    category += param

        return result
316097
def load_config(path)
      return unless File.exist?(path)
      buf = File.read(path) 
      eval("#{buf}", binding, path)
    end
815775
protected static Configuration getConfig(String path) {
		if (cfg == null) {
			cfg = new Configuration();
			cfg.setClassForTemplateLoading(TemplateUtil.class, path == null ? "/templates" : path);
			cfg.setLocale(Locale.US);
			cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
		}
		return cfg;
	}
396165
def set_config(path):
    
    logging.info("LOADING FROM: {}".format(path))
    session.config = load_config(path)
    return session.config
977345
def load_path(self, path):
        '''
        
        '''
        containing_module, _, last_item = path.rpartition('.')
        if last_item[0].isupper():
            # Is a class definition, should do an "import from"
            path = containing_module
        imported_obj = importlib.import_module(path)
        if last_item[0].isupper():
            try:
                imported_obj = getattr(imported_obj, last_item)
            except AttributeError:
                msg = 'Cannot import "%s". ' \
                    '(Hint: CamelCase is only for classes)' % last_item
                raise ConfigurationError(msg)
        return imported_obj
1334513
def config_path(path=None, final=False):
    """"""
    if final and path:
        return path

    if path is None:
        path = default_config_dir()
    try:
        os.makedirs(path)
    except OSError as e:  # pragma: no cover
        if e.errno != errno.EEXIST:
            raise
    return os.path.join(path, 'config.yml')
776041
def _get_config_file_in_folder(cls, path):
        
        if os.path.isfile(path):
            path = os.path.dirname(path)

        for fn in cls.PROJECT_CONFIG_FILES:
            config = RawConfigParser()
            full_path = os.path.join(path, fn)
            if config.read(full_path) and cls._get_section_name(config):
                return full_path
361870
def get_config_path(filename, *search_dirs):
    """"""
    paths = config_search_paths(filename, *search_dirs)

    for path in paths[::-1]:
        if os.path.exists(path):
            return path
97210
def _read_configuration_file(self, path):
        
        parser = RawConfigParser(inline_comment_prefixes=('#', ';'))
        options = None
        should_inherit = True

        if parser.read(path) and self._get_section_name(parser):
            all_options = self._parser.option_list[:]
            for group in self._parser.option_groups:
                all_options.extend(group.option_list)

            option_list = {o.dest: o.type or o.action
                                for o in all_options}

            # First, read the default values
            new_options, _ = self._parse_args([])

            # Second, parse the configuration
            section_name = self._get_section_name(parser)
            for opt in parser.options(section_name):
                if opt == 'inherit':
                    should_inherit = parser.getboolean(section_name, opt)
                    continue

                if opt.replace('_', '-') not in self.CONFIG_FILE_OPTIONS:
                    log.warning("Unknown option '{}' ignored".format(opt))
                    continue

                normalized_opt = opt.replace('-', '_')
                opt_type = option_list[normalized_opt]
                if opt_type in ('int', 'count'):
                    value = parser.getint(section_name, opt)
                elif opt_type == 'string':
                    value = parser.get(section_name, opt)
                else:
                    assert opt_type in ('store_true', 'store_false')
                    value = parser.getboolean(section_name, opt)
                setattr(new_options, normalized_opt, value)

            # Third, fix the set-options
            options = self._fix_set_options(new_options)

        if options is not None:
            if not self._validate_options(options):
                raise IllegalConfiguration('in file: {}'.format(path))

        return options, should_inherit
1258049
def _get_config_dict_from_file(config_path=None):
    
    if config_path is None:
        config_path = DEFAULT_CONFIG_PATH

    # Default (empty) content will be used if config file does not exist.
    config_content = {}

    # If the config file exists we use that content.
    if os.path.isfile(config_path):
        with open(config_path) as fh:
            config_content = json.load(fh)

    return config_content
1175198
private static final String findStringWithFallback(String path,
            UResourceBundle actualBundle, UResourceBundle requested) {
        if (path.length() == 0) {
            return null;
        }
        if (!(actualBundle instanceof ICUResourceBundleImpl.ResourceContainer)) {
            return null;
        }
        if (requested == null) {
            requested = actualBundle;
        }

        ICUResourceBundle base = (ICUResourceBundle) actualBundle;
        ICUResourceBundleReader reader = base.wholeBundle.reader;
        int res = RES_BOGUS;

        // Collect existing and parsed key objects into an array of keys,
        // rather than assembling and parsing paths.
        int baseDepth = base.getResDepth();
        int depth = baseDepth;
        int numPathKeys = countPathKeys(path);
        assert numPathKeys > 0;
        String[] keys = new String[depth + numPathKeys];
        getResPathKeys(path, numPathKeys, keys, depth);

        for (;;) {  // Iterate over the parent bundles.
            for (;;) {  // Iterate over the keys on the requested path, within a bundle.
                ICUResourceBundleReader.Container readerContainer;
                if (res == RES_BOGUS) {
                    int type = base.getType();
                    if (type == TABLE || type == ARRAY) {
                        readerContainer = ((ICUResourceBundleImpl.ResourceContainer)base).value;
                    } else {
                        break;
                    }
                } else {
                    int type = ICUResourceBundleReader.RES_GET_TYPE(res);
                    if (ICUResourceBundleReader.URES_IS_TABLE(type)) {
                        readerContainer = reader.getTable(res);
                    } else if (ICUResourceBundleReader.URES_IS_ARRAY(type)) {
                        readerContainer = reader.getArray(res);
                    } else {
                        res = RES_BOGUS;
                        break;
                    }
                }
                String subKey = keys[depth++];
                res = readerContainer.getResource(reader, subKey);
                if (res == RES_BOGUS) {
                    --depth;
                    break;
                }
                ICUResourceBundle sub;
                if (ICUResourceBundleReader.RES_GET_TYPE(res) == ALIAS) {
                    base.getResPathKeys(keys, baseDepth);
                    sub = getAliasedResource(base, keys, depth, subKey, res, null, requested);
                } else {
                    sub = null;
                }
                if (depth == keys.length) {
                    // We found it.
                    if (sub != null) {
                        return sub.getString();  // string from alias handling
                    } else {
                        String s = reader.getString(res);
                        if (s == null) {
                            throw new UResourceTypeMismatchException("");
                        }
                        return s;
                    }
                }
                if (sub != null) {
                    base = sub;
                    reader = base.wholeBundle.reader;
                    res = RES_BOGUS;
                    // If we followed an alias, then we may have switched bundle (locale) and key path.
                    // Reserve space for the lower parts of the path according to the last-found resource.
                    // This relies on a resource found via alias to have its original location information,
                    // rather than the location of the alias.
                    baseDepth = base.getResDepth();
                    if (depth != baseDepth) {
                        String[] newKeys = new String[baseDepth + (keys.length - depth)];
                        System.arraycopy(keys, depth, newKeys, baseDepth, keys.length - depth);
                        keys = newKeys;
                        depth = baseDepth;
                    }
                }
            }
            // Try the parent bundle of the last-found resource.
            ICUResourceBundle nextBase = base.getParent();
            if (nextBase == null) {
                return null;
            }
            // We probably have not yet set the lower parts of the key path.
            base.getResPathKeys(keys, baseDepth);
            base = nextBase;
            reader = base.wholeBundle.reader;
            depth = baseDepth = 0;  // getParent() returned a top level table resource.
        }
    }
1211818
def read_config(config_path):
    """"""
    result = {}
    with open(config_path, 'r') as fd:
        for line in fd.readlines():
            if '=' in line:
                key, value = line.split('=', 1)
                try:
                    result[key] = json.loads(value)
                except ValueError:
                    result[key] = value.rstrip('\n')
    return result