Checks if given key exists.

        :param section: Current section to check key in.
        :type section: unicode
        :param key: Current key to check.
        :type key: unicode
        :return: Key existence.
        :rtype: bool
491393
def key_exists(self, section, key):
        

        LOGGER.debug("> Checking '{0}' key existence in '{1}' section.".format(key, section))

        self.__settings.beginGroup(section)
        exists = self.__settings.contains(key)
        self.__settings.endGroup()
        return exists
223156
def _set_key(self, key, value):
        

        if is_config_section(value):
            self.add_section(key, value)
            return

        if key not in self._tree or self.settings.key_setter is None:
            if is_config_item(value):
                self.add_item(key, value)
                return

            raise TypeError(
                'Section sections/items can only be replaced with sections/items, '
                'got {type}. To set value use ..[{name}].value = <new_value>'.format(
                    type=type(value),
                    name=key,
                )
            )

        if self.settings.key_setter is None:
            self._default_key_setter(key, value)
        else:
            self.settings.key_setter(subject=self._tree[key], value=value, default_key_setter=self._default_key_setter)
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()
180871
private void put(String section, String key, String value, boolean append) {
        // ignore lines without =
        if (key == null) {
            return;
        }
        if (section == null) {
            put(key, value, append);
            return;
        }
        put(key.isEmpty()
                        ? section
                        : section + '.' + key,
                value, append);
    }
1188220
def get_list(self, section, key):
        
        value = self.get_safe(section, key, [])
        if value == []:
            return value

        # strip comments
        value = re.split(r'\s+#', value)[0]

        # split on commas
        value = value.split(',')

        # strip spaces
        return [x.strip() for x in value]
802517
def check_config(self, section, name, has_default=False, value=None, allowEmpty=False):
    
    

    cfg = self.config
    if not cfg.has_key(section) or not cfg.get(section).has_key(name):
      if not has_default:
        self.config_errors.append("%s: %s -> missing" % (section, name))
        return False
      else:
        return True

    v = cfg.get(section).get(name)

    if v == "" and not allowEmpty:
      self.config_errors.append("%s: %s -> empty" % (section, name))
      return False
    return True
11638
def key_exists(self, key):
        
        assert isinstance(key, str)
        self._close()
        try:
            return self._unsafe_key_exists(key)
        finally:
            self._open()
236082
def get(self, section, key):
        
        line = self._make_line(key)
        for line in self.get_line(section, line):
            yield line.value
97743
def _load_config_section(self, section_name):
        
        if self._config.has_section(section_name):
            # Load specific section
            section = dict(self._config.items(section_name))
        elif self._config.has_section("Default"):
            # Load Default section
            section = dict(self._config.items("Default"))
        else:
            raise KeyError((
                "'{}' was not found in the configuration file and no default " +
                "configuration was provided."
            ).format(section_name))

        # Make sure section is valid
        if "protocol" in section and "host" in section and "token" in section:
            return section
        else:
            raise KeyError(
                "Missing values in configuration data. " +
                "Must contain: protocol, host, token"
            )
174908
def get_key_section_header(self, key, spaces):
        
        if key in self.section_headers:
            header = self.section_headers[key]
        else:
            return ''

        return header
45715
public function isConfigured(array $keys, string $section): bool
    {
        if (!array_key_exists($section, $this->configuration)) {
            return false;
        }

        return !array_diff_key(array_flip($keys), $this->configuration[$section]);
    }
380495
def get(self, section, key, default=MANIFEST_NULL_KEY):
        
        if not self.manifest.has_option(section, key) and default is not MANIFEST_NULL_KEY:
            return default
        return self.manifest.get(section, key)
1224319
def has_option(self, section, option) -> bool:
        
        self.config.read(self.filepath)
        return self.config.has_option(section, option)
907538
def get_section(self, *key):
        
        section = self._get_item_or_section(key)
        if not section.is_section:
            raise RuntimeError('{} is an item, not a section'.format(key))
        return section
411791
public function has(string $section, string $key) : bool
    {
        if ($key == '*') {
            return !!($this->memory[$section] ?? $this->cacheStore->has($section));
        }
        return isset($this->memory[$section]) ? isset($this->memory[$section][$key]) :
            isset($this->cacheStore->get($section, [])[$key]);
    }
1240911
public function hasSection($key)
    {
        if (!\array_key_exists($key, $this->configData)) {
            return false;
        }

        return \is_array($this->configData[$key]);
    }
1101695
public function get($section, $key)
    {
        foreach ($this->lines as $line) {
            if ($line['type'] != 'entry') {
                continue;
            }
            if ($line['section'] != $section) {
                continue;
            }
            if ($line['key'] != $key) {
                continue;
            }
            return $line['value'];
        }

        throw new RuntimeException('Missing Section or Key');
    }