Opposite of Combine
It keeps the values of the current Collection and assign new keys.
964792
public function combineKeys(iterable $keys): self
    {
        if (count($keys) != count($this->items)) {
            $this->doThrow('Invalid input for combineKeys, number of items does not match.', $keys);
        }
        $collection = Factory::create();
        $this->rewind();
        foreach ($keys as $key) {
            $collection->set($key, $this->current());
            $this->next();
        }
        $this->rewind();

        return $collection;
    }
186016
def set(self, key, items):
        """"""
        if not isinstance(items, list):
            raise ValueError("items must be a list")
        with self._lock:
            self._dict[key] = items.copy()
288410
public static <K, V> Map<K, V> newCombinedMap(K[] keys,
            V[] values) {
        HashMap<K, V> map = new HashMap<>();
        for (int i = 0; i < keys.length; i++)
            map.put(keys[i], getValueOfIndex(values, i));
        return map;
    }
1183394
private function array_merge_recursive_keep_keys() {
        $arrays = func_get_args();
        $base = array_shift($arrays);

        foreach ($arrays as $array) {
            reset($base);
            foreach ($array as $key => $value) {
                if (is_array($value) && !empty($base[$key]) && is_array($base[$key])) {
                    $base[$key] = $this->array_merge_recursive_keep_keys($base[$key], $value);
                } else {
                    if (isset($base[$key]) && is_int($key)) {
                        $key++;
                    }
                    $base[$key] = $value;
                }
            }
        }

        return $base;
    }
751999
def update(self, other_dict):
        """"""
        for key, value in iter_multi_items(other_dict):
            MultiDict.add(self, key, value)
108449
function combine(...objects) {
  inv(Array.isArray(objects) && objects.length > 0,
    'You must pass at least one object to instantiate'
  );

  inv(objects.every(isObj),
    'Expecting only plain objects as parameter(s)'
  );

  return assign({}, ...objects);
}
732328
public Collection<V> put(K key, Collection<V> collection) {
    return map.put(key, collection);
  }
1081715
function update (key, value) {
  if (Array.isArray(key)) {
    return AsyncStorage.multiMerge(key.map(([key, val]) => [key, JSON.stringify(val)]))
  }

  return AsyncStorage.mergeItem(key, JSON.stringify(value))
}
1329102
function KeysAnd(values) {
	var vals = this.values = {};
	canReflect.eachKey(values, function(value, key) {
		if (canReflect.isPlainObject(value) && !set.isSpecial(value)) {
			vals[key] = new KeysAnd(value);
		} else {
			vals[key] = value;
		}
	});
}
1055173
function combineAnds(ands) {
	var firstKeys = Object.keys(ands[0].values);
	var keys = {};

	var keysCompare = new is.In(firstKeys);

	firstKeys.map(function(key) {
		keys[key] = [];
	});

	var sameKeys = ands.every(function(and) {
		// have to have the same keys
		if (!set.isEqual(keysCompare, new is.In(Object.keys(and.values)))) {
			return false;
		}
		canReflect.eachKey(and.values, function(value, key) {
			keys[key].push(value);
		});
		return true;
	});
	if (!sameKeys) {
		return;
	}
	// now try to union everything and see if it simplifies ...
	var unequalKeys = [];
	firstKeys.forEach(function(key) {
		var isEqual = keys[key].reduce(function(newSet, lastSetOrFalse) {
			if (lastSetOrFalse === false) {
				return false;
			}
			if (lastSetOrFalse === undefined) {
				return newSet;
			}
			var res = set.isEqual(newSet, lastSetOrFalse);
			return res ? newSet : false;
		});
		if (!isEqual) {
			unequalKeys.push(key);
		}
	});

	if (unequalKeys.length !== 1) {
		return;
	}
	var unionKey = unequalKeys[0];
	// lets see if we can union that one value
	var unioned = keys[unionKey].reduce(function(cur, last) {
		return set.union(cur, last);
	}, set.EMPTY);

	var result = {};
	firstKeys.map(function(key) {
		result[key] = keys[key][0];
	});
	result[unionKey] = unioned;
	return new BasicQuery.KeysAnd(result);
}
422611
def merge!(rel)
      return self if rel.nil?
      MULTI_VALUE_METHODS.each do |method|
        (@values[method] ||= []).concat(rel.values[method]).uniq! unless rel.values[method].nil?
      end

      MULTI_KEY_METHODS.each do |method|
        (@values[method] ||= {}).merge!(rel.values[method]) unless rel.values[method].nil?
      end

      SINGLE_VALUE_METHODS.each do |method|
        @values[method] = rel.values[method] unless rel.values[method].nil?
      end

      self
    end
617714
def _add_child(self, collection, set, child):
        """"""
        added = None
        for c in child:
            if c not in set:
                set.add(c)
                collection.append(c)
                added = 1
        if added:
            self._children_reset()
358709
public Object put(Object key, Object value) {
    return next.put(key, value);
  }
1193721
public static <V, K> V putGetNew(Map<K, V> map, K key, V newValue) {
        synchronized (map) {
            map.put(key, newValue);
            return newValue;
        }
    }
1167516
def swap(self, key, items):
        
        if not isinstance(items, list):
            raise ValueError("items must be a list")
        return_value = []
        with self._lock:
            if key in self._dict:
                return_value = self._dict[key]
            # Make a copy since we don't want users keeping a reference that is
            # outside the lock
            self._dict[key] = items.copy()
        return return_value
663491
public function combine($values): CollectionInterface
    {
        if ($values instanceof IteratorAggregate) {
            $values = $values->getIterator();
        } elseif (is_array($values)) {
            $values = new ArrayIterator($values);
        }

        return $this->wrap(function (Iterator $keys) use ($values) {
            foreach ($keys as $key) {
                yield $key => $values->current();
                $values->next();
            }
        });
    }
1037757
public static <K, V> void putSetMult(Map<K, Set<V>> map, K key,
            Collection<? extends V> values) {
        for (V value : values) {
            putSet(map, key, value);
        }
    }