Dumb implementation (id monkey patch) of a map were
keys are weakely tied
173984
function naiveWeakMap() {
  var self = object.create(naiveWeakMap.prototype);

  self.storage = {};
  self.nextId = 0;

  return self;
}
541663
void buildMapEntry(LinkedHashMap<Object, Expr> map) {
		Expr keyExpr = expr();
		Object key;
		if (keyExpr instanceof Id) {
			key = ((Id)keyExpr).getId();
		} else if (keyExpr instanceof Const) {
			key = ((Const)keyExpr).getValue();
		} else {
			throw new ParseException("Expression error: the value of map key must be identifier, String, Boolean, null or Number", location);
		}
		
		match(Sym.COLON);
		Expr value = expr();
		if (value == null) {
			throw new ParseException("Expression error: the value on the right side of map entry can not be blank", location);
		}
		map.put(key, value);
	}
562726
function(key) {
  this.buffer = new Uint8Array(16);
  this.r = new Uint16Array(10);
  this.h = new Uint16Array(10);
  this.pad = new Uint16Array(8);
  this.leftover = 0;
  this.fin = 0;

  var t0, t1, t2, t3, t4, t5, t6, t7;

  t0 = key[ 0] & 0xff | (key[ 1] & 0xff) << 8; this.r[0] = ( t0                     ) & 0x1fff;
  t1 = key[ 2] & 0xff | (key[ 3] & 0xff) << 8; this.r[1] = ((t0 >>> 13) | (t1 <<  3)) & 0x1fff;
  t2 = key[ 4] & 0xff | (key[ 5] & 0xff) << 8; this.r[2] = ((t1 >>> 10) | (t2 <<  6)) & 0x1f03;
  t3 = key[ 6] & 0xff | (key[ 7] & 0xff) << 8; this.r[3] = ((t2 >>>  7) | (t3 <<  9)) & 0x1fff;
  t4 = key[ 8] & 0xff | (key[ 9] & 0xff) << 8; this.r[4] = ((t3 >>>  4) | (t4 << 12)) & 0x00ff;
  this.r[5] = ((t4 >>>  1)) & 0x1ffe;
  t5 = key[10] & 0xff | (key[11] & 0xff) << 8; this.r[6] = ((t4 >>> 14) | (t5 <<  2)) & 0x1fff;
  t6 = key[12] & 0xff | (key[13] & 0xff) << 8; this.r[7] = ((t5 >>> 11) | (t6 <<  5)) & 0x1f81;
  t7 = key[14] & 0xff | (key[15] & 0xff) << 8; this.r[8] = ((t6 >>>  8) | (t7 <<  8)) & 0x1fff;
  this.r[9] = ((t7 >>>  5)) & 0x007f;

  this.pad[0] = key[16] & 0xff | (key[17] & 0xff) << 8;
  this.pad[1] = key[18] & 0xff | (key[19] & 0xff) << 8;
  this.pad[2] = key[20] & 0xff | (key[21] & 0xff) << 8;
  this.pad[3] = key[22] & 0xff | (key[23] & 0xff) << 8;
  this.pad[4] = key[24] & 0xff | (key[25] & 0xff) << 8;
  this.pad[5] = key[26] & 0xff | (key[27] & 0xff) << 8;
  this.pad[6] = key[28] & 0xff | (key[29] & 0xff) << 8;
  this.pad[7] = key[30] & 0xff | (key[31] & 0xff) << 8;
}
1153086
def default_key_map
      tp = source
      source.bind_key(?\M-n.getbyte(0), 'goto_end'){ tp.goto_end } 
      source.bind_key(?\M-p.getbyte(0), 'goto_start'){ tp.goto_start } 
    end
1213499
@Deprecated
	public static <K, V> Map<V, K> inverse(Map<K, V> map) {
		Map<V, K> inverseMap;
		if (map instanceof LinkedHashMap) {
			inverseMap = new LinkedHashMap<>(map.size());
		} else if (map instanceof TreeMap) {
			inverseMap = new TreeMap<>();
		} else {
			inverseMap = new HashMap<>(map.size());
		}

		for (Entry<K, V> entry : map.entrySet()) {
			inverseMap.put(entry.getValue(), entry.getKey());
		}
		return inverseMap;
	}
597907
function mapValues(keys, app) {
  if (app.option('hints') === false || app.option('skip') === false) {
    return {ask: keys, skip: []};
  }

  var res = {ask: [], skip: []};
  for (var i = 0; i < keys.length; i++) {
    var key = keys[i];
    if (!app.has('cache.data', key)) {
      res.ask.push(key);
    } else {
      app.base.data(key, app.data(key));
      res.skip.push([key, app.data(key)]);
    }
  }
  return res;
}
434083
function(mapping, keys) {
  assert(keys instanceof Array, 'keys must be an array');
  assert(keys.length > 0, 'CompositeKey needs at least one key');

  // Set keys
  this.keys = keys;

  // Set key types
  this.types = [];
  for (var i = 0; i < keys.length; i++) {
    assert(mapping[keys[i]], 'key \'' + keys[i] + '\' is not defined in mapping');
    this.types[i] = mapping[keys[i]];
  }

  // Set covers
  this.covers = keys;
}
1184178
private static String convertMap2Pair(Map<String, String> map) {

        if (CommonUtils.isEmpty(map)) {
            return StringUtils.EMPTY;
        }

        StringBuilder sb = new StringBuilder(128);
        for (Map.Entry<String, String> entry : map.entrySet()) {
            sb.append(getKeyPairs(entry.getKey(), entry.getValue()));
        }

        return sb.toString();
    }
228113
function assignKeysAtPaths(obj, newKeys, paths, loopLen) {
  let result = {};

  for (let i = 0; i < loopLen; i++) {
    // allows for unequal newKeys/paths lengths
    const iPath = paths[i] ? paths[i] : null;
    const iNewKey = newKeys[i] ? newKeys[i] : paths[i].slice(-1);

    const objAtPath = iPath === null ? null : recurPath(obj, iPath);
    const key = objAtPath ? Object.keys(objAtPath)[0] : null;

    const curried = curry(Object.assign, result);

    // prevent same keys from overriding
    if (newKeys) {
      if (objAtPath) {
        curried({ [iNewKey]: objAtPath[key] });
      } else {
        curried({ [iNewKey]: objAtPath });
      }
    } else if (key in result) {
      curried({ [key + '+' + i]: objAtPath[key] });
    } else {
      curried(objAtPath);
    }
  }

  return result;
}
557420
def _merge_maps(m1, m2):
    """"""
    return type(m1)(chain(m1.items(), m2.items()))
1252270
function mapKeyCodeToKey(sKeyCode) {

		// look up number in KeyCodes enum to get the string
		if (!isNaN(sKeyCode)) {
			sKeyCode = getKeyCodeStringFromNumber(sKeyCode);
		}
		if (!sKeyCode) {
			return undefined;
		}
		sKeyCode = sKeyCode.toLowerCase();
		// replace underscores with dash character such as 'ARROW_LEFT' --> 'ARROW-LEFT' and then camelize it --> 'ArrowLeft'
		sKeyCode = camelize(sKeyCode.replace(/_/g, "-"));

		// capitalize key
		var sKey = capitalize(sKeyCode);

		// remove "Digit" and "Numpad" from the resulting string as this info is present within the Location property and not the key property
		// e.g. "Digit9" --> "9"
		if (sKey.startsWith("Digit")) {
			return sKey.substring("Digit".length);
		} else if (sKey.startsWith("Numpad")) {
			sKey = sKey.substring("Numpad".length);
		}

		// special handling where KeyCodes[sKeyCode] does not match
		// e.g. KeyCodes.BREAK --> 'Pause' instead of 'Break'
		switch (sKey) {
			case "Break": return "Pause";
			case "Space": return " ";
			case "Print": return "PrintScreen";
			case "Windows": return "Meta";
			case "Sleep": return "Standby";
			case "TurnOff": return "PowerOff";
			case "Asterisk": return "*";
			case "Plus": return "+";
			case "Minus": return "-";
			case "Comma": return ",";
			case "Slash": return "/";
			case "OpenBracket": return ";";
			case "Dot": return ".";
			case "Pipe": return "|";
			case "Semicolon": return ";";
			case "Equals": return "=";
			case "SingleQUote": return "=";
			case "Backslash": return "\\";
			case "GreatAccent": return "`";
			default: return sKey;
		}
	}
397087
def _fix_mappings(self):
        
        self._mapping.update((key+'=', val+'=') for key, val in self._mapping.items() if not key.endswith('='))

        if config.debug:
            self.LOG.debug("CMD MAPPINGS ARE: %r" % (self._mapping,))
429334
function renameKey(obj, prevKey, nextKey) {
  return mapKeys(obj, (_, key) => (key === prevKey ? nextKey : key))
}
1088015
function applyKey(config, keyPath, value) {
    var currentKey;

    if (Array.isArray(keyPath)) {
        if (config[keyPath[0]] === undefined) { // eslint-disable-line no-undefined
            return;
        }

        currentKey = keyPath.shift();

        if (keyPath.length === 0) {
            config[currentKey] = value;
            return;
        }

        applyKey(config[currentKey], keyPath, value);
    }
}
241458
private static String getInnerMapKey(final String key) {
        final int index = key.indexOf(".");
        return key.substring(index + 1);
    }
994071
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;

    // assign the new value
    memo[targetKey] = obj[key];

    // recurse if an array
    if (Array.isArray(memo[targetKey])) {
      memo[targetKey].forEach((val, idx) => {
        if (Object.prototype.toString.call(val) === '[object Object]') {
          memo[targetKey][idx] = replaceKeyDeep(val, keyMap);
        }
      });
    } else if (Object.prototype.toString.call(memo[targetKey]) === '[object Object]') {
      // recurse if Object
      memo[targetKey] = replaceKeyDeep(memo[targetKey], keyMap);
    }

    // return the modified object
    return memo;
  }, {});
}
747351
private void resizeMap() {
    int[] newUnsortedKeys = Arrays.copyOf(unsortedKeys, unsortedKeys.length * 2);
    int[] newUnsortedValues = Arrays.copyOf(unsortedValues, unsortedValues.length * 2);

    unsortedKeys = newUnsortedKeys;
    unsortedValues = newUnsortedValues;
  }