combines the stats array, in to an object
962676
function stats(resultSet) {
      var response = {};
      if (resultSetIsEmpty(resultSet)) return response;

      // add references to the retrieved server
      response.server = this.serverAddress;

      // Fill the object
      resultSet.forEach(function each(statSet) {
        if (statSet) response[statSet[0]] = statSet[1];
      });

      return response;
    }
1268175
def handle_stats(name, obj):
    
    return {'total_deletions': obj.total['deletions'],
            'total_insertions': obj.total['insertions'],
            'total_lines': obj.total['lines'],
            'total_files': obj.total['files'],
            'changes': obj.files}
863075
def merge(self, other):
        
        self.stats = set(self.stats)
        self.stats.update(set(other.stats))
        self.stats = list(self.stats)
        if other._error:
            self._error = True
949666
void combine(final MomentStatistics b) {
		requireNonNull(b);

		final double m2 = _m2.value();
		final double m3 = _m3.value();

		final double pn = _n;
		final double n = _n + b._n;
		final double nn = n*n;

		final double d = b._m1.value() - _m1.value();
		final double dd = d*d;

		_n += b._n;

		_m1.add(d*b._n/n);

		_m2.add(b._m2).add(dd*pn*b._n/n);

		_m3.add(b._m3)
			.add(dd*d*(pn*b._n*(pn - b._n)/nn))
			.add(3.0*d*(pn*b._m2.value() - b._n*m2)/n);

		final double bnbn = (double)b._n*(double)b._n;

		_m4.add(b._m4)
			.add(dd*dd*(pn*b._n*(pn*pn - pn*b._n + bnbn)/(nn*n)))
			.add(6.0*dd*(pn*pn*b._m2.value() + bnbn*m2)/nn)
			.add(4.0*d*(pn*b._m3.value() - b._n*m3)/n);
	}
157859
function ( obj ) {
		var result = [];

		array.each( obj, function ( i ) {
			array.add( result, i );
		});

		return result;
	}
1209103
def _set_stats(self, input_stats):
        """"""
        # Build the all_stats with the get_raw() method of the plugins
        return {p: self._plugins[p].get_raw() for p in self._plugins if self._plugins[p].is_enable()}
1146044
function merge_objects(obj1,obj2){
        var obj3 = {};
        for (var attrname1 in obj1) { obj3[attrname1] = obj1[attrname1]; }
        for (var attrname2 in obj2) { obj3[attrname2] = obj2[attrname2]; }
        return obj3;
    }
1097503
def get_stats(self, obj, stat_name):
        
        return [int(v) for v in self.send_command_return(obj, stat_name, '?').split()]
901082
function Array_toObject(source) { // @arg Array
                                  // @ret Object
    return Object.keys(source).reduce(function(result, key) {
        result[key] = source[key];
        return result;
    }, {});
}
214573
function array2object(arr, key){

//    if(typeof arr != "object" || !arr.hasOwnProperty("length")){}

    if(!util.isArray(arr) || !key || typeof key != "string"){
        return false;
    }

    var obj = {};
    for(var index in arr){
        if(arr.hasOwnProperty(index)){
            (function(index){
                var k  = arr[index][key];
                obj[k] = arr[index];
            })(index);
        }
    }

    return obj;
}
903791
function objectFromPairs(array) {
  return Array.isArray(array) && array.reduce((a, v) => (a[v[0]] = v[1], a), {});
}
1128384
def init(cls, obj, context):
    """"""
    addr = statsId(obj)
    if addr not in cls.containerMap:
      cls.containerMap[addr] = cls.__getStatContainer(context)
    return cls.containerMap[addr]
193010
def combine_results(self, results):
        """"""
        result = {}
        for key in results[0]:
            result[key] = numpy.concatenate([r[key] for r in results])
        return result
254767
function strArrayToObj (array) {
  return array && array.reduce(function(o, v) {
      o[v] = true;
      return o;
    }, {});
}
1169092
public static Object[][] addToArray(Object original[][], Object item[]) {
		if (original == null) {
			original = new Object[1][];
			original[0] = item;
			return original;
		} else {
			Object original2[][] = new Object[original.length + 1][];
			System.arraycopy(original, 0, original2, 0, original.length);
			original2[original.length] = item;
			return original2;
		}
	}
1031322
def stats(name, array, *extras):
    
    std = numpy.nan if len(array) == 1 else numpy.std(array, ddof=1)
    return (name, numpy.mean(array), std,
            numpy.min(array), numpy.max(array), len(array)) + extras
324191
@SuppressWarnings("rawtypes")
    private Object[] convertToArray(Object obj) {
        // 获取参数的集合信息，并转换成数组
        Object[] values;
        if (obj instanceof Collection) {
            values = ((Collection) obj).toArray();
        } else if (obj.getClass().isArray()) {
            values = (Object[]) obj;
        } else {
            values = new Object[]{obj};
        }
        return values;
    }