Count the number of annotation entries in the database.
430164
def count_annotation_entries(self) -> int:
        """"""
        return self.session.query(NamespaceEntry).filter(NamespaceEntry.is_annotation).count()
440333
def count(self) -> "CountQuery":
        
        return CountQuery(
            db=self._db,
            model=self.model,
            q_objects=self._q_objects,
            annotations=self._annotations,
            custom_filters=self._custom_filters,
        )
831990
def count(self, Class, set=None, recursive=True,ignore=True):
        """"""
        if self.mode == Mode.MEMORY:
            s = 0
            for t in self.data:
                s +=  sum( 1 for e in t.select(Class,recursive,True ) )
            return s
1329056
def count_tags(self):
    ''''''
    for key, model in TAGGED.items():
        collection = '{0}_tags'.format(key)
        results = (model.objects(tags__exists=True)
                        .map_reduce(map_tags, reduce_tags, collection))
        for result in results:
            tag, created = Tag.objects.get_or_create(name=result.key,
                                                     auto_save=False)
            tag.counts[key] = int(result.value) if result.value else 0
            tag.save()
912165
private function logNumberOfConstants(): void
  {
    $n_id  = sizeof($this->labels);
    $n_len = sizeof($this->constants) - $n_id;

    $this->io->writeln('');
    $this->io->text(sprintf('Number of constants based on column widths: %d', $n_len));
    $this->io->text(sprintf('Number of constants based on database IDs : %d', $n_id));
  }
619220
def CountFlowLogEntries(self, client_id, flow_id, cursor=None):
    """"""

    query = ("SELECT COUNT(*) "
             "FROM flow_log_entries "
             "FORCE INDEX (flow_log_entries_by_flow) "
             "WHERE client_id = %s AND flow_id = %s ")
    args = [db_utils.ClientIDToInt(client_id), db_utils.FlowIDToInt(flow_id)]

    cursor.execute(query, args)
    return cursor.fetchone()[0]
618589
def count(cls, filter=None, **kwargs):
        """"""
        from mongoframes.queries import Condition, Group, to_refs

        if isinstance(filter, (Condition, Group)):
            filter = filter.to_dict()

        return cls.get_collection().count(to_refs(filter), **kwargs)
1266688
def count(self, q='*:*', fq=None):
        """"""
        params = {'q': q, 'rows': '0'}
        if fq is not None:
            params['fq'] = fq
        res = self.search(params)
        hits = res['response']['numFound']
        return hits
590455
def get_num_commenters(self, item):
        """"""

        commenters = [comment['user']['login'] for comment in item['comments_data']]
        return len(set(commenters))
237135
def get_count(self, prefix=''):
        """"""
        return sum([self.counters[key]
                    for key in self.messages if key.startswith(prefix)])
293746
def objectcount(data, key):
    """"""
    objkey = key.upper()
    return len(data.dt[objkey])
1076219
private long count(final StringBuilder sql, final List<Object> paramList) throws RepositoryException {
        final Connection connection = getConnection();

        JSONObject jsonObject;
        long count;

        try {
            jsonObject = JdbcUtil.queryJsonObject(sql.toString(), paramList, connection, getName(), debug);
            count = jsonObject.getLong(jsonObject.keys().next());
        } catch (final Exception e) {
            LOGGER.log(Level.ERROR, "Count failed", e);

            throw new RepositoryException(e);
        }

        return count;
    }
478243
def game_counts(n_back=20):
    """"""
    for _, model_name in get_models[-n_back:]:
        games = get_games(model_name)
        print("Model: {}, Games: {}".format(model_name, len(games)))
1320039
def _get_annotation(c, loci):
    """"""
    data_ann_temp = {}
    data_ann = []
    counts = Counter()
    for lid in c.loci2seq:
        # original Py 2.7 code
        #for dbi in loci[lid].db_ann.keys():
        #    data_ann_temp[dbi] = {dbi: map(lambda (x): loci[lid].db_ann[dbi].ann[x].name, loci[lid].db_ann[dbi].ann.keys())}
        # suggestion by 2to3
        for dbi in list(loci[lid].db_ann.keys()):
            data_ann_temp[dbi] = {dbi: [loci[lid].db_ann[dbi].ann[x].name for x in list(loci[lid].db_ann[dbi].ann.keys())]}
            logger.debug("_json_: data_ann_temp %s %s" % (dbi, data_ann_temp[dbi]))
            counts[dbi] += 1
        # original Py 2.7 code
        #data_ann = data_ann + map(lambda (x): data_ann_temp[x], data_ann_temp.keys())
        # suggestion by 2to3
        data_ann = data_ann + [data_ann_temp[x] for x in list(data_ann_temp.keys())]
        logger.debug("_json_: data_ann %s" % data_ann)
    counts = {k: v for k, v in counts.iteritems()}
    total_loci = sum([counts[db] for db in counts])
    valid_ann = [k for k, v in counts.iteritems() if up_threshold(v, total_loci, 0.7)]
    return data_ann, valid_ann
266099
def get_snapshot_count(obj):
    
    try:
        annotation = IAnnotations(obj)
    except TypeError:
        return 0
    storage = annotation.get(SNAPSHOT_STORAGE, [])
    return len(storage)
1186822
def count(self):
        """"""

        # count queries shouldn't care about sorting
        fields_sort = self.fields_sort
        self.fields_sort = self.fields_sort_class()

        self.default_val = 0
        ret = self._query('count')

        # restore previous values now that count is done
        self.fields_sort = fields_sort

        return ret
139433
def count(opts = {})
      view = opts[:view] || @opts[:view]
      # The count that we want is the total documents in the database minus
      # CouchDB design documents.  Asking for the design documents will give us
      # the total count in addition to letting us determine the number of
      # design documents.
      v = client.view(view,
                      include_docs: false,
                      stream: false,
                      startkey: '_design',
                      endkey: '_design0')
      total = v.total_rows
      design_doc_count = v.keys.size
      total - design_doc_count
    end