Return a config section
489354
public function getSection($section) {
		if (!isset($this->configValues[$section])) {
			return null;
		}
		return $this->configValues[$section];
	}
593845
def dump(config):
        
        def _dump(element):
            if not isinstance(element, config.__class__):
                return element

            section = dict()
            for key, subsection in element._subsections.items():
                section[key] = _dump(subsection)
            for key in element:
                section[key] = getattr(element, key)
            return section

        return _dump(config)
114648
def get(self, section, option, default=None):
        
        with self._lock:
            if not self._config.has_option(section, option):
                if default is not None:
                    self._set(section, option, default)
                return default
            return self._config.get(section, option)
247862
def keys(self, section=None):
        """"""
        if not section and self.section:
            section = self.section
        config = self.config.get(section, {}) if section else self.config
        return config.keys()
364233
def parse_config(main_section, *filenames):
    """"""
    filename = filenames[-1]
    filename = os.path.abspath(filename)
    here = os.path.dirname(filename)
    defaults = dict(here=here, hash='#')
    defaults['#'] = '#'

    config = configparser.ConfigParser(
        defaults, allow_no_value=False,
        interpolation=configparser.ExtendedInterpolation(),
    )
    config.optionxform = str
    config.read([os.path.expanduser('~/.irc3/passwd.ini')] + list(filenames))

    value = {}
    for s in config.sections():
        items = {}
        for k, v in config.items(s):
            if '\n' in v:
                v = as_list(v)
            elif v.isdigit():
                v = int(v)
            elif v.replace('.', '').isdigit() and v.count('.') == 1:
                v = float(v)
            elif v in ('true', 'false'):
                v = v == 'true' and True or False
            items[k] = v
        if s == main_section:
            value.update(items)
        else:
            for k in ('here', 'config'):
                items.pop(k, '')
            value[s] = items
    value.update(defaults)
    value['configfiles'] = filenames
    return value
38704
def get(self, section, option, as_list=False):
        '''
        
        '''
        ret = super(GitConfigParser, self).get(section, option)
        if as_list and not isinstance(ret, list):
            ret = [ret]
        return ret
547045
def config(self):
        '''  '''
        if self.__config is None:
            config_path = self.locate_config()
            if config_path:
                self.__config = self.read_file(config_path)
                self.__config_path = config_path
        return self.__config
140973
def configurations(self):
        """"""

        if self._confs is not None:
            return self._confs

        with output_capturing():
            module = self.load(self.fpath)
            confs = getattr(module, CONFIGS_MODULE_ATTR)
            confs = listify(confs)

        self._confs = confs

        return confs
1069608
def add_to_config(cls, section, name, value):
        
        if value:
            if not cls._config.has_section(section):
                cls._config.add_section(section)
            cls._config.set(section, name, str(value))
994257
def keys(cls, section=None):
        """"""
        section = section or cls._default_sect
        if section not in cls._conf:
            cls._load(section=section)
        return cls._conf[section].keys()
949260
def read_sections():
    """"""
    config = configparser.ConfigParser()
    config.read(('requirements.ini', 'setup.cfg', 'tox.ini'))
    return [
        (
            name,
            {
                key: parse_value(key, config[name][key])
                for key in config[name]
            }
        )
        for name in config.sections()
        if 'requirements' in name
    ]
1170859
def run_configurations(callback, sections_reader):
    """"""
    base = dict(OPTIONS)
    sections = sections_reader()
    if sections is None:
        logger.info("Configuration not found in .ini files. "
                    "Running with default settings")
        recompile()
    elif sections == []:
        logger.info("Configuration does not match current runtime. "
                    "Exiting")
    results = []
    for section, options in sections:
        OPTIONS.clear()
        OPTIONS.update(base)
        OPTIONS.update(options)
        logger.debug("Running configuration from section \"%s\". OPTIONS: %r",
                     section, OPTIONS)
        results.append(callback())
    return results
1038389
def get_config_section(self, name):
        
        if self.config.has_section(name):
            return self.config.items(name)
        return []
262314
def _call_config(self, method, *args, **kwargs):
        """"""
        return getattr(self._config, method)(self._section_name, *args, **kwargs)
246846
def parse_config(config)
      sections = {"defaults" => []}
      current  = "defaults"
      config.gsub(/#[^\n]*/, "")
        .split(/\n/)
        .map(&:strip)
        .reject(&:empty?)
        .each do |line|
        if IS_SECTION =~ line
          current = line.match(IS_SECTION)[1].strip
          sections[current] ||= []
        else
          sections[current] << line
        end
      end
      sections
    end
418803
def as_dict(config):
    
    settings = defaultdict(lambda: {})
    for section in config.sections():
        for key, val in config.items(section):
            settings[section][key] = val
    return settings
253029
def from_config(cls, config, name, section_key="segmenters"):
        
        section = config[section_key][name]
        segmenter_class_path = section['class']
        Segmenter = yamlconf.import_module(segmenter_class_path)
        return Segmenter.from_config(config, name, section_key=section_key)