Returns the total of all of the values in the list.
504936
public static int sum (int[] list)
    {
        int total = 0, lsize = list.length;
        for (int ii = 0; ii < lsize; ii++) {
            total += list[ii];
        }
        return total;
    }
815068
def sum(self, values):
        
        values = sorted(values)
        try:
            return (values[-1] - values[0]).total_seconds()
        except IndexError, TypeError:
            return 0
44741
public double getAverage() {
        if (!DATA_LIST.isEmpty()) {
            double sum = 0;
            for (DataPoint dataPoint : DATA_LIST) {
                sum += dataPoint.getValue();
            }
            return sum / DATA_LIST.size();
        }
        return 0;
    }
724194
public function getTotal()
    {
        if ($this->total == -1) {
            $this->total = count($this->items);
        }

        return $this->total;
    }
190845
def overall( self, node ):
        """"""
        return sum( [self.value(value,node) for value in self.children(node)] )
627972
public static Object sum(Object[] self, Object initialValue) {
        return sum(toList(self), initialValue, false);
    }
110827
public int sum() {
        int total = 0;
        int N = getNumElements();
        for (int i = 0; i < N; i++) {
            if( data[i] )
                total += 1;
        }
        return total;
    }
554900
def get_total_paid(self) -> Decimal:
        
        query = (
            self.get_splits_query()
        )
        splits = query.all()

        total = Decimal(0)
        for split in splits:
            total += split.value

        return total
855906
public function totalObjects()
    {
        $total = 0;
        if (!empty($this->headers[self::TOTAL]) && is_array($this->headers[self::TOTAL])) {
            $total = (int) $this->headers[self::TOTAL][0];
        }

        return $total;
    }
23758
def value(self):
    """"""
    return self._sum / tf.cast(self._count, self._dtype)
452145
def values(self):
        
        if self._values is None:
            self._values = self.calculateValues()
        return self._values
1347230
def get(self):
        
        values = [e.get() for e in self._entries]
        if len(self._entries) == 1:
            return values[0]
        else:
            return values
1074609
def count(self):
        
        return (
            self
            .mapPartitions(lambda p: [sum(1 for _ in p)])
            .reduce(operator.add)
        )
563754
def values(self):
        
        if ver == (2, 7):
            return self.viewvalues()
        elif ver == (2, 6):
            return self.itervalues()
        elif ver >= (3, 0):
            return self.values()
1341378
def totals(iter, keyfunc, sumfunc):
    
    data = sorted(iter, key=keyfunc)
    res = {}

    for k, group in groupby(data, keyfunc):
        res[k] = sum([sumfunc(entry) for entry in group])

    return res
381223
public List<V> values() {
        List<V> values = new ArrayList<>(size());
        for (List<V> list : map.values()) {
            values.addAll(list);
        }
        return values;
    }
924056
def total_ingredient_amounts(self):
        
        totals = defaultdict(int)
        for id, meta, amount in self.ingredients:
            totals[(id, meta)] += amount
        return totals