Set a configuration entry

    :param key: key name
    :param value: value for this key
    :raises KeyError: if key is not str
17505
def set_entry(key, value):
    
    if type(key) != str:
        raise KeyError('key must be str')
    _config[key] = value
1334675
def set_key(key: str, value: str) -> dict:
    
    if not _conf.path:
        return {}

    if "toml" in _conf.path:
        with open(_conf.path, "r") as f:
            parser = parse(f.read())
        parser["tool"]["commitizen"][key] = value
        with open(_conf.path, "w") as f:
            f.write(parser.as_string())
    else:
        parser = configparser.ConfigParser()
        parser.read(_conf.path)
        parser["commitizen"][key] = value
        with open(_conf.path, "w") as f:
            parser.write(f)

    return _conf.config
359199
def set_key(key: str, value: typing.List[str], persists: bool = True):
    

    if key.endswith('_path') or key.endswith('_paths'):
        for index in range(len(value)):
            value[index] = environ.paths.clean(value[index])

    if len(value) == 1:
        value = value[0]

    environ.configs.put(**{key: value}, persists=persists)
    environ.configs.save()
    environ.log('[SET]: "{}" to "{}"'.format(key, value))
684913
def set_header(self, key: str, value: str) -> None:
        
        self.headers[key] = value
706817
def set_value_for_key(self, key, value):
        
        if key in self.options:
            self.options[key]['value'] = value
621315
function set(key, value) {
  var k = this.getKey(key);
  var name = this.getName(key);
  if(this.conf.native && typeof(value) == 'string') {
    try {
      value = native.to(
        value, this.conf.native.delimiter, this.conf.native.json);
    }catch(e){}
  }
  this[name] = process.env[k] = value;
}
33857
@JsonAnySetter
    public void putConfigurationValue(String key, Object value) {
        this.configuration.put(key, value);
    }
718884
def config_value_for(key, default = nil, check_live = true)
      key = key.to_s
      value = check_live ? self[key.to_s] : nil
      value || config[key] || self.class.config_value_for(key) || default
    end
1194541
async def set_config(cls, name: str, value):
        
        return await cls._handler.set_config(name=[name], value=[value])
984777
def add_key_value(self, key, value):
        
        if key == 'unique_id':
            self._unique_id = str(value)
        else:
            self._data[key] = value
100013
public Configuration set(String key, String value) {
    checkReadOnly();

    properties.put(key, value);
    return this;
  }
284873
def add(self, key, value):
        
        self.configfile.add(self.name, key, value)
232634
def key_on(self, value):
        
        if isinstance(value, BASESTRING):
            value = (value,)
        self._key_on = value
851456
def set(self, key, value, *args, **kwargs):
        
        if self.cfg.jsonpickle:
            value = jsonpickle.encode(value)
        return self.conn.set(key, value, *args, **kwargs)
1069852
def get_value(self, key):
        # type: (str) -> Any
        
        try:
            return self._dictionary[key]
        except KeyError:
            raise ConfigurationError("No such key - {}".format(key))
316632
def set_config_item(self, key, value):
        
        try:
            old_value = self.get_config_item(key)
        except KeyError:
            old_value = None

        # Get everything to unicode with python2
        if isinstance(value, str):
            value = value.decode()
        elif isinstance(value, list):
            for i in range(len(value)):
                if isinstance(value[i], str):
                    value[i] = value[i].decode()

        # Check if it's a list
        def set_key(key, value):
            self.clear_config_item(key)
            if isinstance(value, list):
                for entry in value:
                    if not _lxc.Container.set_config_item(self, key, entry):
                        return False
            else:
                _lxc.Container.set_config_item(self, key, value)

        set_key(key, value)
        new_value = self.get_config_item(key)

        # loglevel is special and won't match the string we set
        if key == "lxc.loglevel":
            new_value = value

        if (isinstance(value, unicode) and isinstance(new_value, unicode) and
                value == new_value):
            return True
        elif (isinstance(value, list) and isinstance(new_value, list) and
                set(value) == set(new_value)):
            return True
        elif (isinstance(value, unicode) and isinstance(new_value, list) and
                set([value]) == set(new_value)):
            return True
        elif old_value:
            set_key(key, old_value)
            return False
        else:
            self.clear_config_item(key)
            return False
1116613
def cmd_config_set(key, value):
    

    habucfg = loadcfg(environment=False)
    habucfg[key.upper()] = value
    with Path('~/.habu.json').expanduser().open('w') as f:
        f.write(json.dumps(habucfg, indent=4, sort_keys=True))