Store an item in the cache indefinitely.

        :param key: The cache key
        :type key: str

        :param value: The value
        :type value: mixed
338720
def forever(self, key, value):
        
        namespace = self._tags.get_namespace()

        self._push_forever_keys(namespace, key)

        self._store.forever(
            '%s:%s' % (hashlib.sha1(encode(self._tags.get_namespace())).hexdigest(), key),
            value
        )
906753
public int put(Object key, int value)
  {
    if (key == null)
      key = NULL_KEY;

    synchronized (this) {
      int hash = key.hashCode() & _mask;

      for (Item item = _entries[hash]; item != null; item = item._next) {
        Object testKey = item._key;

        if (testKey == key || testKey.equals(key)) {
          int oldValue = item._value;

          item._value = value;

          return oldValue;
        }
      }

      Item item = new Item(key, value);
      item._next = _entries[hash];

      _entries[hash] = item;

      _size++;
    }

    return NULL;
  }
845159
def store(self, key, value):
        
        self.client.set(key, value, time=self.timeout)
566950
def put(self, key, value, overwrite=True):
        
        self._get_table()
        s = self.to_string(value)
        log.debug("Storing in key '%s' the object: '%s'" % (key, s))
        self.table.put_item(
            data={
                'key': key,
                'value': s,
            },
            overwrite=overwrite
        )
915742
public Object put(CacheKey key, Object value)
   {
      return put(key, value, false);
   }
232423
def set_item(self, key, value):
        
        keys = list(self.keys())

        # if it exists, update
        if key in keys:
            self.set_value(1,keys.index(key),str(value))

        # otherwise we have to add an element
        else:
            self.set_value(0,len(self),   str(key))
            self.set_value(1,len(self)-1, str(value))
1010124
def set(self, key, value):
        

        data = self._load_file()
        data[key] = value
        self._save_file(data)
739679
def set(self, key, value, expire_in=None):
    
    if key not in self._keystore:
      self._keystore[key] = InMemoryItemValue(expire_in=expire_in)

    k = self._keystore[key]
    """:type k InMemoryItemValue"""
    k.update_expire_time(expire_in)
    k.value = value
1095931
def set(self, key, value):
        """"""
        self.store[key]=value
        return self.store
817435
public V put(K key, V value)
  {
    Entry<V> oldValue = _cache.put(key, new Entry<V>(_expireInterval, value));

    if (oldValue != null)
      return oldValue.getValue();
    else
      return null;
  }
333865
def set(self, key, value):
        
        # the configuration changes, so we invalidate the cached config
        self._full_config = None
        self._override[key] = value
1366655
def cache(self, value):
        """"""
        value = bool(value)
        if self._cache and not value:
            self._clear()
        self._cache = value
636063
@Override
    public void set(String key, Object value, int expiration) {
        Element element = new Element(key, value);
        if (expiration == 0) {
            element.setEternal(true);
        }
        element.setTimeToLive(expiration);
        cache.put(element);
    }
1204106
def Set(self, key, value):
        
        if not value == None: self.prefs[key] = value
        else:                 self.prefs.pop(key)

        self.Dump()
82666
def setitem_without_overwrite(d, key, value):
    
    if key in d:
        raise OverwriteError(key, value, d[key])
    else:
        dict.__setitem__(d, key, value)
1059741
public void put(Object key, Object value) {
    int weight = getWeight(key) + getWeight(value) + OVERHEAD;
    currentWeight += weight;
    if (cache.put(key, value == null ? NULL_VALUE : value) != null) {
      currentWeight -= weight;
    }
  }
157493
def setdefault(self, key, value):
        
        with self.lock:
            if key in self:
                return self.getitem(key)

            else:
                self.setitem(key, value)
                return value