Creates a new variable, or updates an existing one.

@param {String} key - The name of the variable to set.
@param {*} value - The value of the variable to be set.
@param {Variable.types} [type] - Optionally, the value of the variable can be set to a type
186879
function (key, value, type) {
        var variable = this.values.oneNormalizedVariable(key),

            update = { // create an object that will be used as setter
                key: key,
                value: value
            };

        _.isString(type) && (update.type = type);

        // If a variable by the name key exists, update it's value and return.
        // @note adds new variable if existing is disabled. Disabled variables are not updated.
        if (variable && !variable.disabled) {
            variable.update(update);
        }
        else {
            this.values.add(update);
        }

        // track the change if mutation tracking is enabled
        this._postman_enableTracking && this.mutations.track(MUTATIONS.SET, key, value);
    }
466986
function addType(typeName, type) {
	if (types[typeName]) {
		throw new Error("Type already registered '" + typeName + "'");
	}
	types[typeName] = type;
}
332808
public void put(String keyName, Class<?> arrayComponentType, Object value) {
    ArrayValueMap.ArrayValue arrayValue = keyMap.get(keyName);
    if (arrayValue == null) {
      arrayValue = new ArrayValue(arrayComponentType);
      keyMap.put(keyName, arrayValue);
    }
    arrayValue.addValue(arrayComponentType, value);
  }
926278
function checkType(type, key, value, options) {
  options = options || {};

  if (value != undefined) {
    if (options.isArray)
      return checkArray(type, key, value);

    var checker = checkType[type];
    if (checker) return checker(key, value);

    console.warn("Could not check " + key + ", unknown type " + type);
    //    throw TypeError("Could not check "+key+", unknown type "+type);
  } else if (options.required)
    throw SyntaxError(key + " param is required");

}
261402
def add_header(self, key, value):
        

        assert isinstance(key, str), 'header key must be of type str'
        assert isinstance(value, str), 'header value must be of type str'
        self.headers[key] = value
1026351
@Override
    public void setTessVariable(String key, String value) {
        prop.setProperty(key, value);
    }
940566
def create(key, value, options = {})
      last = false
      @stack.each {|s| last = s.create(key, value, options) }
      last
    end
1334977
public void set(String key, Object value) {
		if (globalVar == null) globalVar = new HashMap<String, Object>();
		globalVar.put(key, value);
	}
537442
function add({
  id, path, types: t, key, value,
}) {
  const programPath = path.findParent(p => p.isProgram());
  const keyMapNode = getKeyMapNode({ id, programPath, types: t });

  keyMapNode.properties.push(t.objectProperty(
    t.identifier(key), t.stringLiteral(value),
  ));
}
389373
public function addTypedKeyValue($type, $key, $value)
    {
        if(empty($this->_data[$type]))
            $this->_data[$type] = array();
        $this->_data[$type][$key] = $value;
    }
344212
function(type, args, obj) {
            var val = Lang.merge(DEFAULT_CONFIG.STRINGS.value, args[0]);
            this.cfg.setProperty(DEFAULT_CONFIG.STRINGS.key, val, true);
        }
497670
function(key, val, options) {
      var attrs, current, done;

      // Handle both `"key", value` and `{key: value}` -style arguments.
      if (key == null || _.isObject(key)) {
        attrs = key;
        options = val;
      } else if (key != null) {
        (attrs = {})[key] = val;
      }
      options = options ? _.clone(options) : {};

      // If we're "wait"-ing to set changed attributes, validate early.
      if (options.wait) {
        if (attrs && !this._validate(attrs, options)) return false;
        current = _.clone(this.attributes);
      }

      // Regular saves `set` attributes before persisting to the server.
      var silentOptions = _.extend({}, options, {silent: true});
      if (attrs && !this.set(attrs, options.wait ? silentOptions : options)) {
        return false;
      }

      // Do not persist invalid models.
      if (!attrs && !this._validate(null, options)) return false;

      // After a successful server-side save, the client is (optionally)
      // updated with the server-side state.
      var model = this;
      var success = options.success;
      options.success = function(resp, status, xhr) {
        done = true;
        var serverAttrs = model.parse(resp);
        if (options.wait) serverAttrs = _.extend(attrs || {}, serverAttrs);
        if (!model.set(serverAttrs, options)) return false;
        if (success) success(model, resp, options);
      };

      // Finish configuring and sending the Ajax request.
      var method = this.isNew() ? 'create' : (options.patch ? 'patch' : 'update');
      if (method == 'patch') options.attrs = attrs;
      var xhr = this.sync(method, this, options);

      // When using `wait`, reset attributes to original values unless
      // `success` has been called already.
      if (!done && options.wait) {
        this.clear(silentOptions);
        this.set(current, silentOptions);
      }

      return xhr;
    }
785409
function set(key, value) {
  const entry = this.get(key, true);
  let oldvalue;
  if (entry) {
    oldvalue = entry.value;
    entry.value = value;
  } else {
    oldvalue = this.put(key, value);
    if (oldvalue) oldvalue = oldvalue.value;
  }
  return oldvalue;
}
1239430
function set(key, value) {
  let config = getGlobalConfig();
  if (key && typeof key === 'string' && typeof value !== 'undefined') {
    config = _.set(config, key, value);
  } else if (_.isObject(key)) {
    config = _.merge(config, key);
  } else if (typeof value !== 'undefined') {
    config = _.merge(config, value);
  }
  // update config meta
  config.meta = config.meta || {};
  config.meta.updated_at = Math.round(+new Date() / 1000);
  // write to .serverlessrc file
  writeFileAtomic.sync(serverlessrcPath, JSON.stringify(config, null, 2));
  return config;
}
298732
function (key, value) {
    var Item = this.get('Item');

    if (!(value instanceof Item)) {
      value = new Item(value);
    }

    value.key = value.key || key;
    var i = this.indexOf(key);

    if (i !== -1) {
      this.items[i] = value;
    } else {
      this.items.push(value);
      this.keyMap[key] = this.items.length - 1;
    }

    this.emit('item', key, value);
    return this;
  }
672612
function (value) {
        var handler = Variable.types[this.type] || Variable.types.any;
        return _.isFunction(handler) ? handler(value) : handler.in(value);
    }
253573
function(key, value) {
      if (typeof key === 'object') {
        for (var prop in key) {
          this._set(prop, key[prop]);
        }
      }
      else {
        if (typeof value === 'function') {
          this._set(key, value(this.get(key)));
        }
        else {
          this._set(key, value);
        }
      }
      return this;
    }