Combines values for a given key.
@param key the key is expected to be a Text object, whose prefix indicates
the type of aggregation to aggregate the values.
@param values the values to combine
@param output to collect combined values
505073
public void reduce(Text key, Iterator<Text> values,
                     OutputCollector<Text, Text> output, Reporter reporter) throws IOException {
    String keyStr = key.toString();
    int pos = keyStr.indexOf(ValueAggregatorDescriptor.TYPE_SEPARATOR);
    String type = keyStr.substring(0, pos);
    ValueAggregator aggregator = ValueAggregatorBaseDescriptor
      .generateValueAggregator(type);
    while (values.hasNext()) {
      aggregator.addNextValue(values.next());
    }
    Iterator outputs = aggregator.getCombinerOutput().iterator();

    while (outputs.hasNext()) {
      Object v = outputs.next();
      if (v instanceof Text) {
        output.collect(key, (Text)v);
      } else {
        output.collect(key, new Text(v.toString()));
      }
    }
  }
965232
@Override
    public void aggregate(Aggregate op, long key) {
        int deviceId = Nd4j.getAffinityManager().getDeviceForCurrentThread();
        if (opCounter.get() == null)
            opCounter.set(new AtomicLong(0));

        // we enqueue op for specific device here
        aggregates.get(deviceId).add(new AggregateDescriptor(op, key, opCounter.get().getAndIncrement()));
    }
688852
public static <K, V> void putListMult(Map<K, List<V>> map, K key,
            Collection<? extends V> values) {
        for (V value : values) {
            putList(map, key, value);
        }
    }
862242
public String put(String group, String key, String value) {
		return this.groupedMap.put(group, key, value);
	}
1043240
public void put(String key, String value) {
		if (this.compiledStatement != null) {
			if (value==null) {
				this.compiledStatement.bindNull(compiledStatementBindIndex++);				
			} else {				
				compiledStatement.bindString(compiledStatementBindIndex++, (String) value);
			}
		} else if (values != null) {
			values.put(key, value);
			return;
		}

		names.add(key);
		// values.put(key, value);
		args.add(value);
		valueType.add(ParamType.STRING);
	}
1136710
public Long rpush(Object key, Object... values) {
		Jedis jedis = getJedis();
		try {
			return jedis.rpush(keyToBytes(key), valuesToBytesArray(values));
		}
		finally {close(jedis);}
	}
1344787
public void put(String key, Byte value) {
		if (this.compiledStatement != null) {
			if (value == null) {
				this.compiledStatement.bindNull(compiledStatementBindIndex++);
			} else {
				this.compiledStatement.bindLong(compiledStatementBindIndex++, value);
			}
		} else if (values != null) {
			values.put(key, value);
			return;
		}

		names.add(key);
		// values.put(key, value);
		args.add(value);
		valueType.add(ParamType.BYTE);
	}
1338876
private void set(String key, String... values) {
            String value = get(values);
            
            if (value != null) {
                put(getLabel(key), value);
            }
        }
426392
public function merge($key, $values)
    {
        foreach ((array)$values as $value) {
            $this->add($key, $value);
        }
        $this->stateChanged();
    }
339450
@SuppressWarnings({"unchecked"})
  public void reduce(Object key, Iterator values, OutputCollector output,
                     Reporter reporter) throws IOException {
    Reducer reducer = chain.getReducer();
    if (reducer != null) {
      reducer.reduce(key, values, chain.getReducerCollector(output, reporter),
                     reporter);
    }
  }
487433
public void put(final String key, final Object value) {
        if (TASK_DIRECTORY_KEY.equals(key) && this.values.keySet().contains(TASK_DIRECTORY_KEY)) {
            // ensure that no one overwrites the task directory
            throw new IllegalArgumentException("Invalid key: " + key);
        }

        if (value == null) {
            throw new IllegalArgumentException(
                    "A null value was attempted to be put into the values object under key: " + key);
        }
        this.values.put(key, value);
    }
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;
    }
466004
public void addValueList(String key, String value) {
        Objects.requireNonNull(key, Required.KEY.toString());

        if (!valueMap.containsKey(key)) {
            List<String> values = new ArrayList<>();
            values.add(value);
            
            valueMap.put(key, values);
        } else {
            List<String> values = valueMap.get(key);
            values.add(value);
            
            valueMap.put(key, values);
        }
    }
306169
private void storeInMultiMap(MultiValueMap<String> map, String key, String[] values)
            throws JournalException {
        try {
            map.set(key, values);
        } catch (Exception e) {
            // totally bogus Exception here.
            throw new JournalException(e);
        }
    }
592501
private function addOutput(string $key, string $value = null)
    {
        if (!array_key_exists($key, $this->output)) {
            $this->output[$key] = [];
        }

        $this->output[$key][] = $value;
    }
756496
protected void doSetAllValues( Map<? extends String, ?> values ) {
        if (values != null) {
            document.putAll(Utility.unwrapValues(values));
        }
    }
183233
def average(key)
      values = values_by_key(key)
      total  = values.inject { |sum, n| sum + n }
      BigDecimal.new(total) / BigDecimal.new(values.count)
    end