Adds the key/value pair to the array, returning a
new array if necessary.
496265
private static Object[] _addToArray(Object[] array, Object key,
            Object value, int increment)
    {
        Object[] newArray = null;
        if (array != null)
        {
            int length = array.length;
            newArray = new Object[length + (2 * increment)];
            System.arraycopy(array, 0, newArray, 2, length);
        }
        else
        {
            newArray = new Object[2 * increment];
        }

        newArray[0] = key;
        newArray[1] = value;
        return newArray;
    }
1158839
public void put(String key, ArrayList<String> value) {
    Iterator<Pair<String, ArrayList<String>>> it = store.iterator();
    while (it.hasNext()) {
      Pair<String, ArrayList<String>> pair = it.next();
      if (key.equals(pair.first)) {
        pair.second = value;
        return;
      }
    }
    store.add(new Pair<>(key, value));
  }
446002
public void add(Key k, Value v) throws IllegalArgumentException {
    add(k, v.get());
  }
573911
public void append(int key, int value) {
        if (mSize != 0 && key <= mKeys[mSize - 1]) {
            put(key, value);
            return;
        }

        int pos = mSize;
        if (pos >= mKeys.length) {
            int n = ArrayUtils.idealIntArraySize(pos + 1);

            int[] nkeys = new int[n];
            int[] nvalues = new int[n];

            // Log.e("SparseIntArray", "grow " + mKeys.length + " to " + n);
            System.arraycopy(mKeys, 0, nkeys, 0, mKeys.length);
            System.arraycopy(mValues, 0, nvalues, 0, mValues.length);

            mKeys = nkeys;
            mValues = nvalues;
        }

        mKeys[pos] = key;
        mValues[pos] = value;
        mSize = pos + 1;
    }
1336750
def add(self, key, val):
        
        key_lower = key.lower()
        new_vals = key, val
        # Keep the common case aka no item present as fast as possible
        vals = _dict_setdefault(self, key_lower, new_vals)
        if new_vals is not vals:
            # new_vals was not inserted, as there was a previous one
            if isinstance(vals, list):
                # If already several items got inserted, we have a list
                vals.append(val)
            else:
                # vals should be a tuple then, i.e. only one item so far
                # Need to convert the tuple to list for further extension
                _dict_setitem(self, key_lower, [vals[0], vals[1], val])
242982
public @Nonnull JsonBuilder putArray(String key, @Nonnull Number... values) {
        JsonArray jjArray = new JsonArray();
        for (Number number : values) {
            jjArray.add(primitive(number));
        }
        object.put(key, jjArray);
        return this;
    }
610893
public @Nonnull JsonBuilder putArray(String key, String... values) {
        JsonArray jjArray = new JsonArray();
        for (String string : values) {
            jjArray.add(primitive(string));
        }
        object.put(key, jjArray);
        return this;
    }
203795
public void put(double[] key, E value) {
        int index = keys.size();
        keys.add(key);
        data.add(value);
        for (Hash h : hash) {
            h.add(index, key, value);
        }
    }
1242233
protected function updateKeys(){
		if(is_array($this->mixValue)){
			$this->_arrKeys = array_keys($this->mixValue);
		}else{
			$this->_arrKeys = array();
		}
	}
82285
def []=(key, value)
      new_entry = entry_to_modify(key, value)
      new_entry[:key] = key
      new_entry[:value] = value
    end
535835
def append_value(dictionary, key, item):
    """"""
    items = dictionary.get(key, [])
    items.append(item)
    dictionary[key] = items
1246174
private void add(String key, String value) {
        checkCapacity(size + 1);
        keys[size] = key;
        vals[size] = value;
        size++;
    }
1369262
public static function addValue(array &$arr, $key, $value)
    {
        if (isset($arr[$key])) {
            if (!is_array($arr[$key])) {
                $arr[$key] = [$arr[$key]];
            }
            $arr[$key][] = $value;
        }
        else {
            $arr[$key] = $value;
        }
    }
1337950
def add(self, key, val):
        
        key_lower = key.lower()
        new_vals = [key, val]
        # Keep the common case aka no item present as fast as possible
        vals = self._container.setdefault(key_lower, new_vals)
        if new_vals is not vals:
            vals.append(val)
984777
def add_key_value(self, key, value):
        
        if key == 'unique_id':
            self._unique_id = str(value)
        else:
            self._data[key] = value
230843
public function add($key, $value)
    {
        $array = array_get($this->configs, $key);

        if (is_array($array)) {
            $array[] = $value;
            array_set($this->configs, $key, $array);
        }


        return $this;
    }
1297037
public function add($key, $value) {
		if ($key === null) {
			if (!is_array($this->data)) {
				$this->data = array();
			}
			$this->data[] = $value;
		} else {
			if (isset($this->data[$key]) && is_array($this->data[$key])) {
				$this->data[$key][] = $value;
			} else {
				$this->data[$key] = array();
				$this->data[$key][] = $value;
			}
		}
	}