Merges this average with another one
763547
public <T extends Average> T merge(T other) {
        if(Util.productGreaterThan(count, (long)Math.ceil(avg), Long.MAX_VALUE) ||
          Util.productGreaterThan(other.count(), (long)Math.ceil(other.average()), Long.MAX_VALUE)) {
            // the above computation is not correct as the sum of the 2 products can still lead to overflow
            // a non-weighted avg
            avg=avg + other.average() / 2.0;
        }
        else { // compute the new average weighted by count
            long total_count=count + other.count();
            avg=(count * avg + other.count() * other.average()) / total_count;
            count=total_count/2;
        }
        return (T)this;
    }
814554
def average(var, key, N):
    ''''''
    global average_data
    if not key in average_data:
        average_data[key] = [var]*N
        return var
    average_data[key].pop(0)
    average_data[key].append(var)
    return sum(average_data[key])/N
93901
def _merge_results(self, results):
        """"""
        self.results['tests'] += results['tests']

        for key, value in results['summary'].items():
            self.results['summary'][key] += value
1195458
public void merge(Metadata other) {
    if (other.isEmpty()) {
      return;
    }
    int remaining = cap() - len();
    if (isEmpty() || remaining < other.len()) {
      expand(len() + other.len());
    }
    System.arraycopy(other.namesAndValues, 0, namesAndValues, len(), other.len());
    size += other.size;
  }
786542
def average(old_avg, current_value, count):
    
    if old_avg is None:
        return current_value
    return (float(old_avg) * count + current_value) / (count + 1)
1135543
public void combine(WSStatistic otherStat) {
        if (!validate(otherStat))
            return;

        AverageStatisticImpl other = (AverageStatisticImpl) otherStat;
        boolean previousCountWasZero = (count == 0);
        count += other.count;
        total += other.total;
        sumOfSquares += other.sumOfSquares;

        // min is min of min, max is max of max
        // need to handle one of the Statistics not having any count so
        // min of 0 isn't reported erroneously
        if (other.count != 0 && (min > other.min || previousCountWasZero == true))
            min = other.min;
        if (max < other.max)
            max = other.max;

        // Compare lastSampleTime
        if (other.lastSampleTime > lastSampleTime)
            lastSampleTime = other.lastSampleTime;
    }
850303
public void combine(WSStatistic otherStat) {
        if (!validate(otherStat))
            return;

        DoubleStatisticImpl other = (DoubleStatisticImpl) otherStat;
        count += other.count;
        //TODO: how to update lastSampleTime???
        //if (other.lastSampleTime > lastSampleTime)
        //  lastSampleTime = other.lastSampleTime;
    }
890188
def merge(self, other):
        """"""
        for key, value in other.items():
            if key in self and (isinstance(self[key], Compound)
                                and isinstance(value, dict)):
                self[key].merge(value)
            else:
                self[key] = value
181694
function mergeInto(one, two) {
  checkMergeObjectArg(one);
  if (two != null) {
    checkMergeObjectArg(two);
    for (var key in two) {
      if (!two.hasOwnProperty(key)) {
        continue;
      }
      one[key] = two[key];
    }
  }
}
995862
function merge (a, b, soft) {
  for (var k in b)
    if (!soft || !a.hasOwnProperty(k)) a[k] = b[k]
  return a
}
390153
def merge(data,skip=50,fraction=1.0):
    """"""

    w,s,d = data.chains.shape
    
    start = int((1.0 - fraction) * s)
    total = int((s - start) / skip)
        
    return data.chains[:,start::skip,:].reshape((w*total,d))
874463
public void merge(final KllFloatsSketch other) {
    if ((other == null) || other.isEmpty()) { return; }
    if (m_ != other.m_) {
      throw new SketchesArgumentException("incompatible M: " + m_ + " and " + other.m_);
    }
    final long finalN = n_ + other.n_;
    for (int i = other.levels_[0]; i < other.levels_[1]; i++) {
      update(other.items_[i]);
    }
    if (other.numLevels_ >= 2) {
      mergeHigherLevels(other, finalN);
    }
    if (Float.isNaN(minValue_) || (other.minValue_ < minValue_)) { minValue_ = other.minValue_; }
    if (Float.isNaN(maxValue_) || (other.maxValue_ > maxValue_)) { maxValue_ = other.maxValue_; }
    n_ = finalN;
    assertCorrectTotalWeight();
    if (other.isEstimationMode()) {
      minK_ = min(minK_, other.minK_);
    }
  }
1076461
def merge (d, o):
    """"""
    for k in o.keys():
        if type(o[k]) is dict and k in d:
            merge(d[k], o[k])
        else:
            d[k] = o[k]
    return d
190663
@Override
	public void merge(MinMaxHolder another){
		Long anotherMin = another.getMaxAsLong();
		if (anotherMin != null){
			evaluate(anotherMin);
		}
		Long anotherMax = another.getMaxAsLong();
		if (anotherMax != null){
			evaluate(anotherMax);
		}
	}
496993
function merge (obj1, obj2) {
  var c = {},
    keys = Object.keys(obj2),
    i;

  for (i = 0; i !== keys.length; i++) {
    c[keys[i]] = obj2[keys[i]];
  }

  keys = Object.keys(obj1);
  for (i = 0; i !== keys.length; i++) {
    if (!c.hasOwnProperty(keys[i])) {
      c[keys[i]] = obj1[keys[i]];
    }
  }

  return c;
}
692872
public void combine(SpdLong other) {
        if (other == null)
            return;
        if (stat.isEnabled() && other.isEnabled())
            stat.combine((CountStatisticImpl) other.getStatistic());
    }
327110
def merge_from(self, other):
        """"""
        if other.pattern is not None:
            self.pattern = other.pattern
        if other.format is not None:
            self.format = other.format
        self.leading_digits_pattern.extend(other.leading_digits_pattern)
        if other.national_prefix_formatting_rule is not None:
            self.national_prefix_formatting_rule = other.national_prefix_formatting_rule
        if other.national_prefix_optional_when_formatting is not None:
            self.national_prefix_optional_when_formatting = other.national_prefix_optional_when_formatting
        if other.domestic_carrier_code_formatting_rule is not None:
            self.domestic_carrier_code_formatting_rule = other.domestic_carrier_code_formatting_rule