Set a value by key.

    Arguments:
        cache:
            instance of Cache

        key:
            'user:342:username',
779125
def set_value(cache, key, value):
    
    with cache as redis_connection:
        return redis_connection.set(key, value)
1116486
def set_if_none(user_config, config, key, value):
    '''
    
    '''

    keys = key.split('.')
    for k in keys[:-1]:
        try:
            user_config = user_config[k]
        except KeyError:
            user_config = {}

        config = config[k]

    key = keys[-1]

    if key not in user_config and not config[key]:
        config[key] = value
312368
def set(key, opts = nil)
      fail ArgumentError, 'Second argument must be a hash' unless opts.is_a?(Hash)
      path  = key_endpoint + key
      payload = {}
      [:ttl, :value, :dir, :prevExist, :prevValue, :prevIndex].each do |k|
        payload[k] = opts[k] if opts.key?(k)
      end
      response = api_execute(path, :put, params: payload)
      Response.from_http_response(response)
    end
433247
def set_evercookie(key, value)
      session[Evercookie.hash_name_for_saved] = {} unless
        session[Evercookie.hash_name_for_saved].present?
      session[Evercookie.hash_name_for_saved][key] = value
    end
421803
def set(self, key, value, **kw):
        

        self.impl.set(key, value, **self._get_cache_kw(kw, None))
616320
protected void putToCache(String cacheName, String key, Object value) {
        putToCache(cacheName, key, value, 0);
    }
584046
def set(self, key, value):
        
        k = self._real_key(key.lower())
        self._override[k] = value
459127
def _set_cache_value(self, key, value, type):
        """"""
        if type is bool:
            if value:
                self[key] = None
            else:
                self.pop(key, None)
        else:
            if value is None:
                self.pop(key)
            elif value is True:
                self[key] = None
            else:
                self[key] = value
19087
def set_locked_variable(self, key, access_key, value):
        
        return self.set_variable(key, value, per_reference=False, access_key=access_key)
38573
def set(ctx, key, value):
    
    if key == "default_account" and value[0] == "@":
        value = value[1:]
    ctx.blockchain.config[key] = value
737184
async def set(self, key, value, param=None, expire_time=None, herd_timeout=None):
        
        identity = self._gen_identity(key, param)
        expected_expired_ts = int(time.time())
        if expire_time:
            expected_expired_ts += expire_time
        expected_expired_ts += herd_timeout or self.default_herd_timeout
        value = self._pack([value, expected_expired_ts])
        return await self.client.set(identity, value, ex=expire_time)
158847
def set(self, key: Any, value: Any) -> None:
        
        if key is not None:
            self[key] = value
206776
def set_value(self, value):
        """"""
        cache, cache_key = self._get_cache_plus_key()
        cache.set(cache_key, value)
706817
def set_value_for_key(self, key, value):
        
        if key in self.options:
            self.options[key]['value'] = value
1202311
def set_(key, value, service=None, profile=None):
    '''
    
    '''
    service = _get_service(service, profile)
    keyring.set_password(service, key, value)
251779
def set(self, key: str, value: str, opt: dict = None) -> None:
        
        self._res_cookies.set(key, value, opt)
495981
def set(self, key, *args):
        """"""
        return self.cache.set(self._hashed(key), *args)