map: key is property name, value [] is of {old value, new value}
493560
public void changedProps(final String filePath, final Map props) {
        history.push(new Action() {
            public ReturnCode execute() {
                final File file = new File(filePath);
                final Properties propsObj = new Properties();
                InputStream is = null;
                OutputStream os = null;
                try {
                    is = new FileInputStream(file);
                    propsObj.load(is);

                    // Restore old property values.
                    Iterator entries = props.entrySet().iterator();
                    while (entries.hasNext()) {
                        Map.Entry entry = (Map.Entry) entries.next();
                        String key = (String) entry.getKey();
                        String value = ((String[]) entry.getValue())[0];
                        propsObj.setProperty(key, value);
                    }

                    os = new FileOutputStream(file);
                    propsObj.store(os, null);
                    return ReturnCode.OK;
                } catch (IOException ioe) {
                    return new ReturnCode(ReturnCode.BAD_INPUT);
                } finally {
                    SelfExtractUtils.tryToClose(is);
                    SelfExtractUtils.tryToClose(os);
                }
            }
        });
    }
1308166
function(data) {

            var map = _map,
                key;

            if (map && data) {
                for (key in data) {
                    if (key && data.hasOwnProperty(key)) {
                        _map[key] = data[key];
                    }
                }
            }

        }
530626
function mapObject(key, value) {
		var c = key.charAt(0);
		if (c === "_" || c === "$") {
			return undefined;
		} else if (isArray(this) && key.match(INTRINSIC)) {
			return undefined;
		} else if (isType(value)) {
			return parse(value);
		} else if (gui.Type.isComplex(value)) {
			switch (value.constructor) {
				case Object:
				case Array:
					return value;
			}
			return undefined;
		} else {
			if (isType(this)) {
				var base = this.constructor.prototype;
				var desc = Object.getOwnPropertyDescriptor(base, key);
				if (desc && (desc.set || desc.get)) {
					return undefined;
				}
			}
			return value;
		}
	}
82285
def []=(key, value)
      new_entry = entry_to_modify(key, value)
      new_entry[:key] = key
      new_entry[:value] = value
    end
237386
function setValue(descriptor,key,set,update)
        {
          var _descriptor = descriptor,
              _key = key,
              _set = set,
              _update = update,
              _oldValue;
          return function valueSet(v)
          {
            _oldValue = _descriptor.value;
            if(_set(this,_key,v,_oldValue,arguments,this._stopChange))
            {
              _descriptor.value = v;
            }
            if(!this._stopChange)
            {
              _update(this,_key,v,_oldValue,arguments);
            }
            this._stopChange = undefined;
          }
        }
906715
function (mapName, index) {
            if (this.maps[mapName][index] === undefined) {
                return [];
            }
            return this.maps[mapName][index].slice(); //slice() makes a copy of the array
        }
957197
function convertPropertyNamesAndValues (context, pkg, map, root, waiting) {
	if(!map) {
		return map;
	}
	var clone = {}, val, name;
	for(var property in map ) {
		val = map[property];
		name = convertName(context, pkg, map, root, property, waiting); 
		val = typeof val === "object"
			? convertPropertyNamesAndValues(context, pkg, val, root, waiting)
			: convertName(context, pkg, map, root, val, waiting);
		if(typeof name !== 'undefined' && typeof val !== 'undefined') {
			clone[name] = val;
		}
	}
	return clone;
}
1149542
@SuppressWarnings("unchecked")
    private static Object getMappedValue(Object obj, Property property, Object key) {
        if (property == null) {
            throw new IllegalArgumentException("Cannot get the mapped value from a 'null' property.");
        }

        if (property.getType().isAssignableFrom(Map.class)) {
            Map<Object, Object> map = (Map<Object, Object>) property.get(obj);

            if (map == null) {
                throw new NullPointerException("Invalid 'null' value found for mapped " + property + " in "
                                                       + obj.getClass().getName() + ".");

            }

            return map.get(key);
        } else {
            throw new IllegalArgumentException("Cannot get a mapped value from the not mapped " + property
                                                       + ". Only Map type is supported, but " + property.getType().getSimpleName() + " found.");
        }
    }
844678
def []=(key,val)
      change_type = keys.include?(key) ? :modified : :added
      changes = changes_for(change_type,:[]=,key,val)
      changing(change_type,:trigger=>:[]=, :changes=>changes) {super}
    end
438118
protected String getAndRemoveValue(Map<String, String> map, String key) {

        String value = map.get(key);
        if (value != null) {
            map.remove(key);
        }
        return value;
    }
400729
function (map) {
            var key;
            for (key in map) {
                if (map.hasOwnProperty(key)) {
                    this._init(key, map[key]);
                }
            }
            return this;
        }
499800
def _mappingGetValueSet(mapping, keys):
    
    setUnion = set()
    for k in keys:
        setUnion = setUnion.union(mapping[k])
    return setUnion
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;
}
907185
function(map) {

  var Fuzzymap = {};
  var Map = map;
  var PureMap = map;
  var LastValue = null;

  if(!_.isArray(map))
    Map = [Map]

  Fuzzymap.Map = function() { return PureMap; };
  Fuzzymap.last = function() { return LastValue; };
  Fuzzymap.keys = function() {
    return _.chain(Map)
      .compact()
      .map(function(mapDefinition) {
        return _.keys(mapDefinition);
      })
      .flatten()
      .uniq()
      .value();
  }

  Fuzzymap.map = function(item) {
    LastValue = item;
    
    if(_.isObject(item))
      testObject(item);
    else
      testItem(item);

    return Fuzzymap.last();
  };

  Fuzzymap.extract = function(item) {
    LastValue = item;

    if(!_.isObject)
      return item;

    return extractObject(item);
  };

  var extractObject = function(param) {
    var result = {};
    var defaults = {};
    _.each(Map, function(MapGroup) {
      _.each(_.keys(MapGroup), function(key) {
        if(!defaults.hasOwnProperty(key))
          defaults[key] = null;
      });
    });

    _.each(_.keys(param), function(key) {
      var mappedKey = testItem(key);
      if(defaults.hasOwnProperty(mappedKey))
        defaults[mappedKey] = param[key];
    });

    return defaults;
  };

  var testObject = function(param) {
    var result = {};
    _.each(_.keys(param), function(key) {
      var mappedKey = testItem(key);
      result[mappedKey] = param[key];
    });
    LastValue = result;
    
    return result;
  };

  var testItem = function(item) {
    LastValue = item;
    _.find(Map, function(MapGroup) {
      return testGroup(item, MapGroup) !== false;
    });

    return Fuzzymap.last();
  };
    
  var testGroup = function(item, MapGroup) {
    if(nil(MapGroup))
      MapGroup = {};

    var mapped = _.find(_.keys(MapGroup), function(mapString) {
      var regexes = MapGroup[mapString];

      if(!_.isArray(regexes))
        regexes = [regexes];

      var regex = _.find(regexes, function(regex) {
        return nil(item.match(regex)) === false;
      });
      
      return nil(regex) === false;
    });

    if(!nil(mapped))
      LastValue = mapped;
    
    return nil(mapped) === false;

  };

  return Fuzzymap;
}
1281449
@SuppressWarnings("unchecked")
	protected Map<String, Object> getNestedMap(Map<String, Object> map, String key) {
		Object value = map.get(key);
		if (value == null) {
			return Collections.emptyMap();
		}
		return (Map<String, Object>) value;
	}
287839
@SuppressWarnings("unchecked")
    private static void setMappedValue(Object obj, Property property, Object key, Object value, ObjectWrapper options) {
        if (property == null) {
            throw new IllegalArgumentException("Cannot set a new mapped value to a 'null' property.");
        }

        if (Map.class.isAssignableFrom(property.getType())) {
            Map map = (Map) property.get(obj);

            if (map == null) {
                if (options.isAutoInstancing) {
                    map = new LinkedHashMap();
                    property.set(obj, map);
                } else {
                    throw new NullPointerException("Invalid 'null' value found for the mapped '" + property + "' in "
                                                           + obj.getClass().getName() + " object.");
                }
            }

            map.put(key, value);
        } else {
            throw new IllegalArgumentException("Cannot set a new mapped value to " + property
                                                       + ". Only Map type is supported for mapped properties, but " + property.getType().getName()
                                                       + " found.");
        }
    }
1173090
protected void replaceValue(Map<String, Object> content, String key, Object value) {
		if (content.containsKey(key) && value != null) {
			content.put(key, value);
		}
	}