Converts the list of keys and values that comprise an AMQP encoded
map into a proper javascript map/object.
512578
function mapify(elements) {
    var result = {};
    for (var i = 0; i+1 < elements.length;) {
        result[elements[i++]] = elements[i++];
    }
    return result;
}
409600
function _getValue(fromObject, key, keys) {
  var regArray = /(\[\]|\[(.*)\])$/g
    , match
    , arrayIndex
    , isValueArray = false
    , result
    ;

  if (!fromObject) {
    return;
  }

  match = regArray.exec(key);
  if (match) {
    key = key.replace(regArray, '');
    isValueArray = (key !== '');
    arrayIndex = match[2];
  }

  if (keys.length === 0) {
    if (isValueArray) {
      if (typeof arrayIndex === 'undefined' || fromObject[key] === undefined) {
        result = fromObject[key];
      } else {
        result = fromObject[key][arrayIndex];
      }
    } else if (Array.isArray(fromObject)) {
      if (key === '') {
        if (typeof arrayIndex === 'undefined') {
          result = fromObject;
        } else {
          result = fromObject[arrayIndex];
        }
      } else {
        result = fromObject.map(function (item) {
          return item[key];
        })
      }
    } else {
      result = fromObject[key];
    }
  } else {
    if (isValueArray) {
      if (Array.isArray(fromObject[key])) {
        if (typeof arrayIndex === 'undefined') {
          result = fromObject[key].map(function (item) {
            return _getValue(item, keys[0], keys.slice(1));
          });
        } else {
          result = _getValue(fromObject[key][arrayIndex], keys[0], keys.slice(1));
        }
      } else {
        if (typeof arrayIndex === 'undefined') {
          result = _getValue(fromObject[key], keys[0], keys.slice(1));
        } else {
          if (fromObject[key] === undefined) {
            return;
          }
          result = _getValue(fromObject[key][arrayIndex], keys[0], keys.slice(1));
        }
      }
    } else if (Array.isArray(fromObject)) {
      if (key === '') {
        if (typeof arrayIndex === 'undefined') {
          result = _getValue(fromObject, keys[0], keys.slice(1));
        } else {
          result = _getValue(fromObject[arrayIndex], keys[0], keys.slice(1));
        }
      } else {
        result = fromObject.map(function (item) {
          result = _getValue(item, keys[0], keys.slice(1));
        })
      }
      if (typeof arrayIndex === 'undefined') {
        result = fromObject.map(function (item) {
          return _getValue(item, keys[0], keys.slice(1));
        });
      } else {

        result = _getValue(fromObject[arrayIndex], keys[0], keys.slice(1));
      }
    } else {
      result = _getValue(fromObject[key], keys[0], keys.slice(1));
    }
  }

  return result;
}
1197288
function createCacheMap() {

	if (typeof Map === 'function') {
		return new Map();
	}

	var keys = [];
	var values = [];

	function getIndex(key) {
		return keys.indexOf(key);
	}

	function get(key) {
		return values[getIndex(key)];
	}

	function has(key) {
		return getIndex(key) !== -1;
	}

	function set(key, value) {
		var index = getIndex(key);
		if (index === -1) {
			index = keys.push(key) - 1;
		}
		values[index] = value;
	}

	function deleteFunc(key) {
		var index = getIndex(key);
		if (index === -1) {
			return false;
		}
		delete keys[index];
		delete values[index];
		return true;
	}

	function forEach(callback) {
		keys.forEach(function(key, index) {
			if (key !== undefined) {
				callback(values[index], key);
			}
		});
	}

	return {
		set: set,
		get: get,
		has: has,
		delete: deleteFunc,
		forEach: forEach,
	};
}
1195964
static Map<String, Object> valueAsMap(Map<String, Object> map, Key key, Map<String, Object> defaultValue) {
        if (map.containsKey(key.key)) {
            Object rawOrMap = map.get(key.key);
            if (rawOrMap instanceof Map) {
                @SuppressWarnings("unchecked")
                Map<String, Object> submap = (Map<String, Object>) rawOrMap;
                return submap;
            } else {
                return defaultValue;
            }
        }
        return defaultValue;
    }
1097529
public static <K, V> Map<K, V> zipMap(Iterable<K> keys, Iterable<V> values) {
    Map<K, V> retVal = new LinkedHashMap<>();

    Iterator<K> keysIter = keys.iterator();
    Iterator<V> valsIter = values.iterator();

    while (keysIter.hasNext()) {
      final K key = keysIter.next();

      Preconditions.checkArgument(valsIter.hasNext(),
                                  "number of values[%s] less than number of keys, broke on key[%s]",
                                  retVal.size(), key);

      retVal.put(key, valsIter.next());
    }

    Preconditions.checkArgument(!valsIter.hasNext(),
                                "number of values[%s] exceeds number of keys[%s]",
                                retVal.size() + Iterators.size(valsIter), retVal.size());

    return retVal;
  }
552144
function mapToObject ( map, opts ) {
	const length = map.getLength();
	const data = {};
	for ( let i = 0; i < length; i++ ) {
		const key = map.getKey(i).getValue();
		const value = getJsonValueFromSassValue(map.getValue(i), opts);
		data[key] = value;
	}
	return data;
}
1226329
public static <K, V> ArrayList<V> valuesOfKeys(Map<K, V> map, Iterable<K> keys) {
		return valuesOfKeys(map, keys.iterator());
	}
700482
function mapCacheSet(key, value) {
    var data = getMapData(this, key),
      size = data.size;

    data.set(key, value);
    this.size += data.size == size ? 0 : 1;
    return this;
  }
65227
function getOwnKeys(map) {
        var keys = [];
        for (var key in map)
            if (hasOwnProperty.call(map, key)) {
                keys.push(key);
            }
        return keys;
    }
808695
private static Object convertMapToObj(Map<String, Object> map, Class clazz) {
        ObjectMapper mapper = new ObjectMapper();
        Object obj = mapper.convertValue(map, clazz);
        return obj;
    }
385414
@UsedByGeneratedCode
    public static Map mapOf(Object... values) {
        int len = values.length;
        if (len % 2 != 0) {
            throw new IllegalArgumentException("Number of arguments should be an even number representing the keys and values");
        }

        Map answer = new LinkedHashMap(len / 2);
        int i = 0;
        while (i < values.length - 1) {
            answer.put(values[i++], values[i++]);
        }
        return answer;
    }
1104805
public static Map toMap(Object[] keys, Object[] values) {
		Map map = new HashMap<>();
		int i = 0;
		for (Object key : keys) {
			map.put(key, values[i++]);
		}
		return map;
	}
867768
function map (obj) {
  var key, val, arr = []
  for (key in obj) {
    val = obj[key]
    if (Array.isArray(val))
      for (var i = 0; i < val.length; i++)
        arr.push([key, val[i]])
    else if (typeof val === 'object')
      for (var prop in val)
        arr.push([key + '[' + prop + ']', val[prop]])
    else
      arr.push([key, val])
  }
  return arr
}
910672
function map(obj, iterator, context) {
		var results = [], i, j;

		if (!obj) return results;

		// Use native .map method if it exists:
		if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);

		// Fallback for native .map:
		for (i = 0, j = obj.length; i < j; i++ ) {
			results[i] = iterator.call(context, obj[i], i, obj);
		}
		return results;
	}
361639
@Override
	public Map<String, Object> readKeyValues() {
		Map<String, Object> result = new HashMap<String, Object>();
		readKeyValues(result);
		return result;
	}
1231580
def get_as_array(self, key):
        
        value = self.get(key)
        return AnyValueMap.from_value(value)
1112605
function mapValues (mapping) {
      var result = {}
      for (var property in mapping) {
        result[property] = parseInt(values[mapping[property]], 10)
      }
      return result
    }