count occurences for each (metro, POI) record
551645
def reducer_count(self, key, values):
        
        total = sum(values)
        metro, poi = key
        # group data by metro areas for final output    
        yield metro, (total, poi)
858736
function tally(pathname, offenses) {
    var count = offenses.length,
        plural = count > 1 ? 'errors' : 'error';

    function perOffense(o) {
        if (!errors[pathname]) {
            errors[pathname] = [];
        }

        if (o) {
            errors[pathname].push({
                line: o.line,
                col: o.character,
                msg: o.reason,
                evidence: o.evidence || ''
            });
        }
    }

    log.error([count, plural, 'in', pathname].join(' '));
    offenses.forEach(perOffense);
}
341056
def _filter_occurrences(count, relat_op):
    """"""
    # Filter the occurrences equal (or not equal) to a given value
    if "eq" in relat_op:
        count = dfilter(lambda x: x == relat_op["eq"], count)
    elif "ne" in relat_op:
        count = dfilter(lambda x: x != relat_op["ne"], count)

    # Filter the occurrences lower (or equal) than a given value
    if "lt" in relat_op:
        count = dfilter(lambda x: x < relat_op["lt"], count)
    elif "le" in relat_op:
        count = dfilter(lambda x: x <= relat_op["le"], count)

    # Filter the occurrences greater (or equal) than a given value
    if "gt" in relat_op:
        count = dfilter(lambda x: x > relat_op["gt"], count)
    elif "ge" in relat_op:
        count = dfilter(lambda x: x >= relat_op["ge"], count)
    return count
356197
def count_of_certain_kind(kind):
        '''
        
        '''

        recs = TabPost.select().where(TabPost.kind == kind)

        return recs.count()
1185363
def _count(self, X, Y):
        """"""

        self.feature_count_ += safe_sparse_dot(Y.T, X)
        self.class_count_ += Y.sum(axis=0)
651154
def next_occurrences(num, from = nil, options = {})
      from = TimeUtil.match_zone(from, start_time) || TimeUtil.now(start_time)
      enumerate_occurrences(from + 1, nil, options).take(num)
    end
1000681
def count_of_wells(self):
        
        xs = set([w.attrib['WellX'] for w in self.wells])
        ys = set([w.attrib['WellY'] for w in self.wells])
        return (len(xs), len(ys))
1053858
def count(self, seqs, nreport=100, scan_rc=True):
        
        for matches in self.scan(seqs, nreport, scan_rc):
            counts = [len(m) for m in matches]
            yield counts
264552
def count_by_type(self,table,timesteps):
        """"""
        hbonds = defaultdict(int)
        for contact in table:
            #count by residue name not by proteinring
            pkey = (contact.donor_idx,contact.acceptor_idx,contact.donor_atom, contact.acceptor_atom,contact.donor_resnm,contact.donor_resid, contact.acceptor_resnm,contact.acceptor_resid)
            hbonds[pkey]+=1
        dtype = [("donor_idx",int),("acceptor_idx",int),("donor_atom","|U4"),("acceptor_atom","|U4"),("donor_resnm","|U8"),("donor_resid","|U8"),("acceptor_resnm","|U8"),("acceptor_resid","|U8"),("frequency",float) ]
        out = np.empty((len(hbonds),),dtype=dtype)
        tsteps = float(len(timesteps))
        for cursor,(key,count) in enumerate(hbonds.iteritems()):
            out[cursor] = key + (count / tsteps,)
        return out.view(np.recarray)
1236910
def _create_counts(out_dts, out_dir):
    """"""
    ma, ma_mirna = _merge(out_dts)
    out_ma = op.join(out_dir, "counts.tsv")
    out_ma_mirna = op.join(out_dir, "counts_mirna.tsv")
    ma.to_csv(out_ma, sep="\t")
    ma_mirna.to_csv(out_ma_mirna, sep="\t")
    return out_ma_mirna, out_ma
1325667
def found_duplicates(counts):
    
    _logger.warning("Duplicated markers found")
    for marker, count in counts:
        _logger.warning(" - {}: {:,d} times".format(marker, count))
    _logger.warning("Appending ':dupX' to the duplicated markers according "
                    "to their location in the file.")
799339
def array_repeat(col, count):
    
    sc = SparkContext._active_spark_context
    return Column(sc._jvm.functions.array_repeat(_to_java_column(col), count))
613242
def _total_counts(seqs, seqL, aligned=False):
    
    total = Counter()
    if isinstance(seqs, list):
        if not aligned:
            l = len([total.update(seqL[s].freq) for s in seqs])
        else:
            l = len([total.update(seqL[s].freq) for s in seqs if seqL[s].align > 0])
    elif isinstance(seqs, dict):
        [total.update(seqs[s].get_freq(seqL)) for s in seqs]
        l = sum(len(seqs[s].idmembers) for s in seqs)
    return total, l
1247990
def countByValue(self):
        
        return self.map(lambda x: (x, 1)).reduceByKey(lambda x, y: x+y)
1120765
def print_event_count():
    """"""
    for source in archive.list_event_sources():
        event_count = 0
        for group in archive.list_event_histogram(source):
            for rec in group.records:
                event_count += rec.count
        print('  {: <40} {: >20}'.format(source, event_count))
139801
def count(expr):
    

    if isinstance(expr, SequenceExpr):
        unique_input = _extract_unique_input(expr)
        if unique_input:
            return nunique(unique_input).rename('count')
        else:
            return Count(_value_type=types.int64, _input=expr)
    elif isinstance(expr, SequenceGroupBy):
        return GroupedCount(_data_type=types.int64, _input=expr.to_column(),
                            _grouped=expr.input)
    elif isinstance(expr, CollectionExpr):
        return Count(_value_type=types.int64, _input=expr).rename('count')
    elif isinstance(expr, GroupBy):
        return GroupedCount(_data_type=types.int64, _input=expr.input,
                            _grouped=expr).rename('count')
61230
function count(req, res, next) {
  db.posts.count(function(err, count) {
    if(err) { return next(err); }
    res.json({count: count});
  });
}