output for average

@function avg
@param {Array} input - line parsed
@param {String} output - header
@return {Array}
11611
function avg(input, output) {

  var event = input[0];
  if (event.what === 0 && event.total === 0) {
    return [];
  }
  return [ output, [ 'total', cyan + event.what.toFixed(3) + close ],
    [ 'average', cyan + (event.what / event.total).toFixed(3) + close ],
    [ 'max', cyan + event.max.toFixed(3) + close ],
    [ 'min', cyan + event.min.toFixed(3) + close ], [ '' ] ];
}
1222858
def AvgPool(a, k, strides, padding, data_format):
    
    if data_format.decode("ascii") == "NCHW":
        a = np.rollaxis(a, 1, -1),

    patches = _pool_patches(a, k, strides, padding.decode("ascii"))
    pool = np.average(patches, axis=tuple(range(-len(k), 0)))

    if data_format.decode("ascii") == "NCHW":
        pool = np.rollaxis(pool, -1, 1)

    return pool,
65289
def variance(arr):
  
  avg = average(arr)
  return sum([(float(x)-avg)**2 for x in arr])/float(len(arr)-1)
405514
def parse_resultsline(self, line):
        

        split_row = [token.strip() for token in line.split('\t')]
        if len(split_row) == 1:
            self._currentanalysiskw = split_row[0]
            return 0

        # 'Average\t\t-----\t-----\t-----\t-----\t-----\t\t-----\t\t\t\t-----'
        elif split_row[0] == 'Average':
            return 0
        # '%RSD\t\t-----\t-----\t-----\t-----\t-----\t\t-----\t\t\t\t-----'
        elif split_row[0] == '%RSD':
            return 0
        # 'Maximum\t\t-----\t-----\t-----\t-----\t-----\t\t-----\t\t\t\t-----'
        elif split_row[0] == 'Maximum':
            return 0
        # 'Minimum\t\t-----\t-----\t-----\t-----\t-----\t\t-----\t\t\t\t-----'
        elif split_row[0] == 'Minimum':
            return 0
        # 'Std. Dev.\t\t-----\t-----\t-----\t-----\t-----\t\t-----\t\t\t\t----'
        elif split_row[0] == 'Std. Dev.':
            return 0
        else:
            self._currentresultsheader = ['Title%s' % i for i
                                          in range(len(split_row))]
            _results = {'DefaultResult': 'Title3'}
            _results.update(dict(zip(self._currentresultsheader, split_row)))

            result = _results[_results['DefaultResult']]
            column_name = _results['DefaultResult']
            result = self.zeroValueDefaultInstrumentResults(
                                                    column_name, result, line)
            _results[_results['DefaultResult']] = result

            val = re.sub(r"\W", "", self._currentanalysiskw)
            self._addRawResult(_results['Title1'],
                               values={val: _results},
                               override=False)
1099677
public static double avg(Array array) throws ExpressionException {
	if (array.size() == 0) return 0;
	return sum(array) / array.size();
    }
1012743
function(lines) {
		let output = [];
		let newlineCount = 0;
		for (let i = 0; i < lines.length; i++) {
			const line = lines[i];
			if (!line.trim()) {
				newlineCount++;
			} else {
				newlineCount = 0;
			}

			if (newlineCount >= 2) continue;

			output.push(line);
		}
		return output;
	}
32002
def average(self):
        ""
        result = DefaultBunch(str)

        #  if possible
        if self.size:
            result.update(
                (key, '' if isinstance(val, basestring) else val / self.size)
                for key, val in self.total.items()
            )

        # Handle time fields
        #for key, fielddef in  engine.FieldDefinition.FIELDS.items():
        #    if key in result and fielddef._matcher is matching.TimeFilter:
        #       result[key] = ''
        #for key, fielddef in  engine.FieldDefinition.FIELDS.items():
        #    if key in result and fielddef._matcher is matching.TimeFilter:
        #        result[key] = engine._fmt_duration(result[key])
        #print self.total
        #print result
        return result
570881
function summariser(results) {
    var response = [],
        callback = function(output) {
            response.push(output);
        };

    var passed = 0;
    if (results.hasOwnProperty('passed')) {
        passed = countSpecs(results.passed);
    }
    var failed = 0;
    if (results.hasOwnProperty('failed')) {
        failed = countSpecs(results.failed);
    }
    var pending = 0;

    if (results.hasOwnProperty('pending')) {
        pending = countSpecs(results.pending);
    }
    var total = passed + failed + pending;

    coloriseOutput(total + ' Specs defined', 'bold', callback);
    if (total > 0) {
        coloriseOutput(passed + ' Passed' + displayPercentage(total, passed), 'green', callback);
        coloriseOutput(failed + ' Failed' + displayPercentage(total, failed), 'red', callback);
        coloriseOutput(pending + ' Pending' + displayPercentage(total, pending), 'yellow', callback);
    }
    return response;
}
430783
function printStats() {
  _.each(statsTracker, function(vals, stat) {
    var numStats = vals.length;
    var total = _.reduce(vals, function(memo, num) {
      return memo + num;
    }, 0);
    var avg = parseFloat(total / numStats).toFixed(4) + 'ms';
    var printableTotal = parseFloat(total).toFixed(4) + 'ms';
    logger.log(stat + ': ' + avg + ' (' + printableTotal + ' / ' + numStats + ')');
  });
  statsTracker = {};
}
212280
public static function AVERAGE()
    {
        $returnValue = $aCount = 0;

        // Loop through arguments
        foreach (PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()) as $k => $arg) {
            if ((is_bool($arg)) &&
                ((!PHPExcel_Calculation_Functions::isCellValue($k)) || (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE))) {
                $arg = (integer) $arg;
            }
            // Is it a numeric value?
            if ((is_numeric($arg)) && (!is_string($arg))) {
                if (is_null($returnValue)) {
                    $returnValue = $arg;
                } else {
                    $returnValue += $arg;
                }
                ++$aCount;
            }
        }

        // Return
        if ($aCount > 0) {
            return $returnValue / $aCount;
        } else {
            return PHPExcel_Calculation_Functions::DIV0();
        }
    }
1192683
function (property, callback) {
        this.sum(property, function (sum) {
            this.count(property, function (count) {
                this.fn('avg', callback).call(this, sum/count)
            })
        })
    }
299340
function variance(array) {
  var length = array.length;

  if (length === 0) {
    throw new RangeError('Error');
  }

  var index = -1;
  var mean = 0;

  while (++index < length) {
    mean += array[index] / length;
  }

  var result = 0;

  for (var i = 0; i < length; i++) {
    result += Math.pow(array[i] - mean, 2);
  }

  return 1 / length * result;
}
434025
def _averageFromList(self, param):
        
        _result = 0.0
        _count = 0

        for _param in param.split(','):
            if _param != '' and float(_param) != 0.0:
                _result = _result + float(_param)
                _count  += 1

        if _count >= 1:
            _result = _result / _count
        return _result
727401
function Bias(average, rowBiases, colBiases) {
	this.average = average;		// Overall value average
	this.rowBiases = rowBiases; // Bias for each row
	this.colBiases = colBiases;	// Bias for each column
}
183233
def average(key)
      values = values_by_key(key)
      total  = values.inject { |sum, n| sum + n }
      BigDecimal.new(total) / BigDecimal.new(values.count)
    end
450498
function mean( out, x ) {
	var len = x.length,
		i;
	if ( out.length !== len ) {
		throw new Error( 'mean()::invalid input arguments. Input and output matrices must be the same length.' );
	}
	for ( i = 0; i < len; i++ ) {
		out.data[ i ] = MEAN( x.data[ i ] );
	}
	return out;
}
174895
function sizeOutput(output) {
  let size = 0;
  size += encoding.sizeVarint(output.value);
  size += sizeScript(output.script);
  return size;
}