Replaces the given key/value for each element.
        If the key is not present silently passes.
164257
def kreplace(self, key, value):
        
        for item in self:
            if key in item:
                item[key] = value
1173498
def modify(key, value, tree)
      # if already set, just change value
      return false unless tree[key]

      tree[key] = value
      true
    end
631842
function(key) {
    if (arguments.length === 0) {
      // reset all values, including non-enumerable and readonly properties
      this.key_list.forEach(function(key) {
        this._reset(key);
      }, this);

    } else {
      this._reset(key);
    }
  }
542488
def update(self, E=None, **F):
        
        if E is not None:
            if hasattr(E, 'keys'):
                for K in E:
                    self.replace(K, E[K])
            elif hasattr(E, 'items'):
                for K, V in E.items():
                    self.replace(K, V)
            else:
                for K, V in E:
                    self.replace(K, V)
        for K in F:
            self.replace(K, F[K])
39770
public List<V> replace(K key, Collection<? extends V> values) {
		List<V> replaced = removeAll(key);
		putAll(key, values);
		return replaced;
	}
675047
def update(self, key, value):
        
        if not isinstance(value, dict):
            raise BadValueError(
                'The value {} is incorrect.'
                ' Values should be strings'.format(value))
        if key in self.data:
            v = self.get(key)
            v.update(value)
        else:
            v = value
        self.set(key, v)
277388
@Override
  public boolean replace    ( TypeK  key, TypeV  oldValue, TypeV newValue ) {
    return Objects.equals(putIfMatch( key, newValue, oldValue ), oldValue);
  }
777995
@Nullable
  public synchronized V put(K key, V value) {
    // We do remove and insert instead of just replace, in order to cause a structural change
    // to the map, as we always want the latest inserted element to be last in the queue.
    V oldValue = mMap.remove(key);
    mSizeInBytes -= getValueSizeInBytes(oldValue);
    mMap.put(key, value);
    mSizeInBytes += getValueSizeInBytes(value);
    return oldValue;
  }
541234
def update(self, key, value):
        
        if not is_string(key):
            raise Exception("Key must be string")

        # if len(key) > 32:
        #     raise Exception("Max key length is 32")

        if not is_string(value):
            raise Exception("Value must be string")

        # if value == '':
        #     return self.delete(key)
        old_root = copy.deepcopy(self.root_node)
        self.root_node = self._update_and_delete_storage(
            self.root_node,
            bin_to_nibbles(to_string(key)),
            to_string(value))
        self.replace_root_hash(old_root, self.root_node)
99611
public static final String replaceValueIfKeyIsPassword(String key, String value)
  {
    return replacePossiblePassword(containsPassword(key),value);
  }
1036606
def kremove(self, key, value=None):
        
        for item in self:
            if value is None:
                # Just pop the key if present,
                # otherwise return None
                # (shortcut to ignore the exception)
                item.pop(key, None)
            else:
                try:
                    # Use the key as a set
                    item[key].remove(value)
                    # If the set contains a single element
                    # just store the latter
                    if len(item[key]) == 1:
                        item[key] = item[key].pop()
                except KeyError:
                    # This happens when the item
                    # does not contain the key
                    pass
                except AttributeError:
                    # This happens when the key is not a set
                    # and shall be removed only if values match
                    if item[key] == value:
                        item.pop(key)
1173090
protected void replaceValue(Map<String, Object> content, String key, Object value) {
		if (content.containsKey(key) && value != null) {
			content.put(key, value);
		}
	}
771504
function replaceKeyDeep(obj, keyMap) {
  return Object.keys(obj).reduce((memo, key)=> {

    // determine which key we are going to use
    let targetKey = keyMap[key] ? keyMap[key] : key;

    if (Array.isArray(obj[key])) {
      // recurse if an array
      memo[targetKey] = obj[key].map((val) => {
        if (Object.prototype.toString.call(val) === '[object Object]') {
          return replaceKeyDeep(val, keyMap);
        }
        return val;
      });
    } else if (Object.prototype.toString.call(obj[key]) === '[object Object]') {
      // recurse if Object
      memo[targetKey] = replaceKeyDeep(obj[key], keyMap);
    } else {
      // assign the new value
      memo[targetKey] = obj[key];
    }

    // return the modified object
    return memo;
  }, {});
}
170404
def set(self, key: str, value: str, opt: dict = None) -> None:
        
        self[key] = value
        if opt is not None:
            self[key].update(opt)
1280862
function (text, replacements) {
        'use strict';
        var keys = getKeysFromTemplate(text),//Object.keys(replacements),
            len = keys.length,
            i = 0,
            key,
            value;
        while (i < len) {
            key = keys[i];
            if (key.indexOf('.') !== -1) {
                value = getNestedValue(replacements, key);
            } else {
                value = replacements[key];
            }
            if (value) {
                text = text.split('{' + key + '}').join(value);
            }
            i += 1;
        }
        return text;
    }
50989
def assoc(self, key, value):
        
        return self._replace(user_ctx={
            **self.user_ctx,
            key: value,
        })
99739
def replace(key, value, ttl=nil, options=nil)
      perform(:replace, key, value, ttl_or_default(ttl), 0, options)
    end