Gets the aggregate stat for the given stat.
493635
def getAggregator(cls, instanceId, name):
    """"""
    parent = cls.parentMap.get(instanceId)
    while parent:
      stat = cls.getStat(parent, name)
      if stat:
        return stat, parent
      parent = cls.parentMap.get(statsId(parent))
1039008
public static String getAggregatedResultHuman(Map<String, LinkedHashSet<String>> aggregateResultMap){

        StringBuilder res = new StringBuilder();

        for (Entry<String, LinkedHashSet<String>> entry : aggregateResultMap
                .entrySet()) {
            LinkedHashSet<String> valueSet = entry.getValue(); 
            res.append("[" + entry.getKey() + " COUNT: " +valueSet.size() + " ]:\n");
            for(String str: valueSet){
                res.append("\t" + str + "\n");
            }
            res.append("###################################\n\n");
        }
        
        return res.toString();
        
    }
341498
def aggregate(self, *args, **kwargs):
        
        obj = self._clone()
        obj._facets = [] #reset facets
        from django.db.models import Avg, Max, Min

        for arg in args:
            if isinstance(arg, (Avg, Max, Min)):

                field, djfield = self._django_to_es_field(arg.lookup)
                if not djfield:
                    obj = obj.annotate(field)
                from pyes.facets import StatisticalFacet

                obj = obj.annotate(StatisticalFacet(field, field))
        facets = obj.get_facets()
        #collecting results
        result = {}
        for name, values in facets.items():
            for k, v in values.items():
                if k.startswith("_"):
                    continue
                result[u'%s__%s' % (name, k)] = v

        return result
832766
static StatsData aggregateStats(Collection<StatsData> dataSet) {
        StatsData combined = new StatsData();
        for (StatsData stats : dataSet) {
            if (stats.count == 0) {
                continue;
            }
            if (combined.total == 0) {
                combined.min = stats.min;
                combined.max = stats.max;
            }
            combined.total = combined.total + stats.total;
            combined.count = combined.count + stats.count;
            combined.mean = combined.total / combined.count;
            combined.min = Math.min(combined.min, stats.min);
            combined.max = Math.max(combined.max, stats.max);

            // Sum of the squares of the difference from the mean
            double meanDifference = stats.mean - combined.mean;
            combined.varianceNumeratorSum += stats.varianceNumeratorSum + stats.count * meanDifference * meanDifference;
        }
        return combined;
    }
368161
private Double aggregate(Datasource ds, Collection<Double> values) {
        return ((values.size() / m_intervalsPer) > ds.getXff()) ? ds.getAggregationFuction().apply(values) : Double.NaN;
    }
444557
def get_stats(self, obj, stat_name):
        
        return [int(v) for v in self.get_attribute(obj, stat_name).split()]
1091430
def aggregateStatsDF(stats_df):
    ''' '''

    grouped = stats_df.groupby("UMI")

    agg_dict = {'counts': [np.median, len, np.sum]}
    agg_df = grouped.agg(agg_dict)

    agg_df.columns = ['median_counts', 'times_observed', 'total_counts']
    return agg_df
34982
def _get_aggregated_info(self):
        
        agg_results = {}
        for key in self.aggregated_info['occurrences']:
            agg_results[key] = {
                'occurrences': self.aggregated_info['occurrences'].get(key),
                'coverage': (float(self.aggregated_info['occurrences']
                                   .get(key))/float(self.get_metadata('items_count')))*100
            }
        return agg_results
567673
def get_top(self, stat, n):
        """'"""
        return sorted(self.stats, key=lambda x: getattr(x, stat), reverse=True)[:n]
872358
def get_aggregate_by_id(self, account_id: str) -> AccountAggregate:
        
        account = self.get_by_id(account_id)
        return self.get_account_aggregate(account)
756128
function getScore (stats) {
    return calc.aggregate([TITLE_W, COMPETITOR_W, INSTALLS_W, RATING_W, AGE_W],
                          [stats.titleMatches.score, stats.competitors.score,
                           stats.installs.score, stats.rating.score, stats.age.score]);
  }
177340
public static StatsImpl getStats(DataDescriptor dd, boolean recursive) {
        if (disabled)
            return null;
        return getStats(findModuleItem(dd), recursive);
    }
287593
def _use_aggregation(self, agg, columns=None):
        """"""
        if not columns:
            columns = self._columns
        from pyspark.sql import functions as F
        aggs = map(lambda column: agg(column).alias(column), self._columns)
        aggRdd = self._grouped_spark_sql.agg(*aggs)
        df = DataFrame.from_schema_rdd(aggRdd, self._by)
        return df
640250
def get_aggs(self):
        

        res = self.fetch_aggregation_results()
        if 'aggregations' in res and 'values' in res['aggregations'][str(self.parent_agg_counter - 1)]:
            try:
                agg = res['aggregations'][str(self.parent_agg_counter - 1)]['values']["50.0"]
                if agg == 'NaN':
                    # ES returns NaN. Convert to None for matplotlib graph
                    agg = None
            except Exception as e:
                raise RuntimeError("Multivalue aggregation result not supported")

        elif 'aggregations' in res and 'value' in res['aggregations'][str(self.parent_agg_counter - 1)]:
            agg = res['aggregations'][str(self.parent_agg_counter - 1)]['value']

        else:
            agg = res['hits']['total']

        return agg
34831
def aggregate(self, **filters):
        """"""
        url = URL.aggregate.format(**locals())
        return self.get_pages(url, **filters)
296859
public StatisticImpl getStatistic() {
        StatisticImpl aggStat = _getAggregate();
        aggStat.setLastSampleTime(System.currentTimeMillis());
        return aggStat;
    }
410957
@Override
  public void aggregate()
  {
    final ArrayOfDoublesSketch update = selector.getObject();
    if (update == null) {
      return;
    }
    synchronized (this) {
      union.update(update);
    }
  }