Get the number of names that exist and are not expired
        Return {'status': True, 'count': count} on success
        Return {'error': ...} on error
337729
def rpc_get_num_names( self, **con_info ):
        
        db = get_db_state(self.working_dir)
        num_names = db.get_num_names()
        db.close()

        return self.success_response( {'count': num_names} )
712428
def get_num_names_owned( state_engine, checked_ops, sender ):
    
    
    count = 0
    registers = find_by_opcode( checked_ops, "NAME_REGISTRATION" )

    for reg in registers:
        if reg['sender'] == sender:
            count += 1

    count += len( state_engine.get_names_owned_by_sender( sender ) )
    log.debug("Sender '%s' owns %s names" % (sender, count))
    return count
428427
def rpc_get_num_names_in_namespace( self, namespace_id, **con_info ):
        
        if not check_namespace(namespace_id):
            return {'error': 'Invalid name or namespace', 'http_status': 400}

        db = get_db_state(self.working_dir)
        num_names = db.get_num_names_in_namespace( namespace_id )
        db.close()

        return self.success_response( {'count': num_names} )
1173648
def count_delayed_jobs(cls, names):
        
        return sum([queue.delayed.zcard() for queue in cls.get_all(names)])
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']
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()
237135
def get_count(self, prefix=''):
        """"""
        return sum([self.counters[key]
                    for key in self.messages if key.startswith(prefix)])
967376
def exists(self):
        
        if '_id' not in self or self['_id'] is None:
            return False

        resp = self.r_session.head(self.document_url)
        if resp.status_code not in [200, 404]:
            resp.raise_for_status()

        return resp.status_code == 200
628346
def namedb_get_num_names_in_namespace( cur, namespace_id, current_block ):
    
    unexpired_query, unexpired_args = namedb_select_where_unexpired_names( current_block )

    query = "SELECT COUNT(name_records.name) FROM name_records JOIN namespaces ON name_records.namespace_id = namespaces.namespace_id WHERE name_records.namespace_id = ? AND " + unexpired_query + " ORDER BY name;"
    args = (namespace_id,) + unexpired_args

    num_rows = namedb_select_count_rows( cur, query, args, count_column='COUNT(name_records.name)' )
    return num_rows
939610
def rpc_get_all_names_cumulative( self, offset, count, **con_info ):
        
        if not check_offset(offset):
            return {'error': 'invalid offset', 'http_status': 400}

        if not check_count(count, 100):
            return {'error': 'invalid count', 'http_status': 400}

        db = get_db_state(self.working_dir)
        all_names = db.get_all_names( offset=offset, count=count, include_expired=True )
        db.close()

        return self.success_response( {'names': all_names} )
558011
def count(self):
        
        if self._batch:
            raise CQLEngineException("Only inserts, updates, and deletes are available in batch mode")

        if self._result_cache is None:
            query = self._select_query()
            query.count = True
            result = self._execute(query)
            return result[0]['count']
        else:
            return len(self._result_cache)
866017
def count(self, item):
        """"""
        # pylint: disable=arguments-differ
        key, value = item
        return 1 if key in self._dict and self._dict[key] == value else 0
875266
def count(self):
        
        self.request_params.update({'sysparm_count': True})
        response = self.session.get(self._get_stats_url(),
                                    params=self._get_formatted_query(fields=list(),
                                                                     limit=None,
                                                                     order_by=list(),
                                                                     offset=None))

        content = self._get_content(response)

        return int(content['stats']['count'])
332827
def error_count(self):
        """"""
        count = 0
        for error_list in self.error_dict.values():
            count += len(error_list)
        return count
327832
def find_count_label(d):
    
    for name in COUNT_NAMES:
        if name in d:
            return name
    for name in COUNT_NAMES:
        if str(name).lower() in d:
            return name
117551
def get_name_at( self, name, block_number, include_expired=False ):
        
        cur = self.db.cursor()
        return namedb_get_name_at(cur, name, block_number, include_expired=include_expired)
305959
def count(self):
        

        try:
            return self.object_list.count()
        except (AttributeError, TypeError):
            # AttributeError if object_list has no count() method.
            # TypeError if object_list.count() requires arguments
            # (i.e. is of type list).
            return len(self.object_list)