Set a defined key with the given value
@param  {string} key          The name of the value
@param  {mixed}  data         The data to store, can be any datatype
@param  {int}    [expiresAt]  When should this value expire
@return {void}
775077
function set(key, data, expiresAt) {
            try {
                if (expiresAt !== undefined && typeof expiresAt === 'number') {
                    STORE.setItem(storeName + key + EXPIRE_KEY, expiresAt.toString());
                }

                STORE.setItem(storeName + key, decodeObjectString(data));

                return true;
            } catch(error) {
                console.error(error);
                return false;
            }
        }
1307603
function(key, data) {
        var currentData;
        currentData = settings[key] || {};
        settings[key] = _.extend(currentData, data);
      }
407704
def set(self, key, value):
        
        value_encoded = encode(value, self.get_change_trigger(key))

        if key in self.data and self.data[key] == value_encoded:
            return self

        self.data[key] = value_encoded
        return self.trigger_changed(key)
44115
function setItem(key, value) {
  var expires = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;

  if (!isCookieEnabled) {
    session.setItem(key, value);
    log('I\'ve saved "' + key + '" in a plain object :)', 'warning', debug);
    return;
  }

  cookie.set(key, value, { expires: expires });
  log('I\'ve saved "' + key + '" in a cookie :)', 'warning', debug);
}
670546
private function setExpires(Memento\Key $key, $expires)
    {
        if (is_null($expires) || !is_integer($expires)) {
            return;
        }
        $this->__connect($key);

        $expiresKey = $this->groupKey ? $this->groupKey : $key;

        return $this->redis->expire($expiresKey->getKey(), $expires);
    }
450033
function set (data, key, value) {
  if (Object(key) === key) {
    mix(data, key);
    return;
  }

  var keys = _keys(key);
  keys && _set(data, keys, value);
}
156246
def set(self, key, data):
        '''
        
        '''
        if isinstance(data, dict):
            self._volatile_data[key] = {k: v for (k, v) in data.items()}
        else:
            self._volatile_data[key] = data
113072
function(key, expires) {
  var registry = getFile(cache.registry);
  registry[key] = expires;
  setFile(cache.registry, registry);
  log.info(format('Cache object %s set to expire at %s.', key, expires));
}
534930
def set_key(self, key):
        
        is_non_empty_string(key)

        self.policies.append(('eq', '$key', key))
        self.form_data['key'] = key
        self.key = key
153328
@Override
    public CompletableFuture<Void> setExpireSecondsAsync(String key, int expireSeconds) {
        return (CompletableFuture) send("EXPIRE", null, (Type) null, key, key.getBytes(UTF8), String.valueOf(expireSeconds).getBytes(UTF8));
    }
1290642
function(key, value) {
        var hashCode = hash(key);
        if (!(hashCode in this.data)) {
            this.keys.push(key);
            this.values.push(value);
        }
        this.data[hashCode] = value;
    }
514016
function setExpiry(key, ms, req) {
  var rval = this.getRawKey(key);
  if(rval === undefined) return 0;
  // expiry is in the past or now, delete immediately
  // but return 1 to indicate the expiry was set
  if(ms <= Date.now()) {
    this.delKey(key, req);
    return 1;
  }
  if(!this._expires[key]) {
    this._ekeys.push(key);
  }
  this._expires[key] = ms;
  rval.e = ms;
  return 1;
}
814448
public function set($key, $data, $expire = 0) {
		if ($data instanceof ModelArray) {
			$modelArray = explode('\\', get_class($data[0]));
			$modelName = count($data) == 0 ? '': end($modelArray);
			$data = [
				'__fsm' => [
					'm' => $modelName,
					'a' => 1
				],
				'data' => $data->toArray()
			];
		} else if ($data instanceof Model) {
			$modelArray = explode('\\', get_class($data));
			$modelName = count($data) == 0 ? '': end($modelArray);
			$data = [
				'__fsm' => [
					'm' => $modelName,
					'a' => 0
				],
				'data' => $data->toArray()
			];
		}
		//print_r($data);
		CacheFactory::getCache()->set($key, $data, $expire);
	}
599354
function(key) {

            // get value and time left
            var ret = {
                value: this._storage.getItem(key),
                timeLeft: this.getTimeLeft(key),
            };

            // set if expired
            ret.isExpired = ret.timeLeft !== null && ret.timeLeft <= 0;

            // return data
            return ret;
        }
1109951
public function set(string $field, string $key, $data, int $expire = 0): bool
    {
        // 缓存数据
        $this->doSet($key, $data, $expire);

        //记录调试信息
        self::debugSet($field . ':' . $key, $data);

        //生成FIELD对象
        $field = Redis::list(self::PREFIX . self::PREFIX_FIELD . $field);

        //向FIELD中增加一个键
        $field->append($key);
        return true;
    }
732887
function (key) {
            const value = db.get(key);

            if (!value) {
                db.set(key, {
                    frozen: true
                });
                return;
            }

            db.set(key, {
                intent: value.intent,
                message: value.message,
                editor: value.editor,
                time: value.time,
                frozen: true
            });

            return true;
        }
1284035
function(key, value, expiration) {

            // set item
            var ret = this._storage.setItem(key, value);

            // set expiration timestamp (only if defined)
            if (expiration) {
                this.updateExpiration(key, expiration);
            }

            // return set value return value
            return ret;
        }