Count the number of viewed records.
193099
def count_records(self, record_counter, file):
        """"""
        counter = record_counter
        events_counter = 0
        for record in file.get_records():
            recid = record[2]
            counter[recid] = counter.get(recid, 0) + 1
            events_counter += 1

        self.stat['user_record_events'] = events_counter
        return counter
920252
def view_count_plus(slug):
        '''
        
        '''
        entry = TabWiki.update(
            view_count=TabWiki.view_count + 1,
        ).where(TabWiki.uid == slug)
        entry.execute()
803428
def _get_count_pagination(self, base, oldest_neighbor, newest_neighbor):
        

        count = self.spec['count']

        out_spec = {**base, 'count': count, 'order': self._order_by}

        if self._order_by == 'newest':
            older_view = View({**out_spec,
                               'last': oldest_neighbor}) if oldest_neighbor else None

            newer_count = View({**base,
                                'first': newest_neighbor,
                                'order': 'oldest',
                                'count': count}) if newest_neighbor else None
            newer_view = View({**out_spec,
                               'last': newer_count.last}) if newer_count else None

            return older_view, newer_view

        if self._order_by == 'oldest':
            older_count = View({**base,
                                'last': oldest_neighbor,
                                'order': 'newest',
                                'count': count}) if oldest_neighbor else None
            older_view = View({**out_spec,
                               'first': older_count.last}) if older_count else None

            newer_view = View({**out_spec,
                               'first': newest_neighbor}) if newest_neighbor else None

            return older_view, newer_view

        return None, None
713960
def count(self, **query_dict):
        """"""
        param_dict = query_dict.copy()
        param_dict['count'] = 0
        resp_dict = self._get_query(**param_dict)
        return resp_dict['response']['numFound']
1107119
def count(self, item):
        """"""
        try:
            return self.items.get(item, 0)
        except TypeError:
            return self.items.get(repr(item), 0)
293746
def objectcount(data, key):
    """"""
    objkey = key.upper()
    return len(data.dt[objkey])
71449
def count_of_certain_kind(kind):
        '''
        
        '''

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

        return recs.count()
228756
def count(self):
        
        if self._result_cache is not None and not self._iter:
            return len(self._result_cache)

        return self.query.get_count()
904146
def count(self, key):
        """"""
        count = 0
        pos = self.index(key, -1)
        if pos == -1:
            return count
        count += 1
        for i in range(pos+1, len(self)):
            if self[i][0] != key:
                break
            count += 1
        return count
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
103168
def count(self):
        ""
        if getattr(self, '_count', None) is None:
            self._count = getattr(self.node, 'count', 0)
        return self._count
1078754
def count_of_current_url(current_url):
        '''
        
        '''
        res = TabLog.select().where(TabLog.current_url == current_url)
        return res.count()
511750
def filter_counter(self, counter, min=2, max=100000000):
        
        records_filterd = {}
        counter_all_records = 0
        for item in counter:
            counter_all_records += 1
            if max > counter[item] >= min:
                records_filterd[item] = counter[item]

        self.stat['user_record_events'] = counter_all_records
        self.stat['records_filtered'] = len(records_filterd)
        return records_filterd
26245
def observe(self, amount):
        """"""
        self._count.inc(1)
        self._sum.inc(amount)
1190811
def records(self):
        """"""

        return (self._session.query(Process)
                .filter(Process.d_vid == self._d_vid)).all()
783753
def count(self):
        
        cmd = ("select COUNT(*) from {table} "
               "{join_clause}{where_clause}{order_clause}").format(
                    table=self.table_name,
                    where_clause=self.where_clause,
                    join_clause=self.join_clause,
                    order_clause=self.order_clause).rstrip()
        return Repo.db.execute(cmd, self.where_values)
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