// countExact counts the number of exact values (not wildcards) in
// the given namespace and name.
762450
func (x *Intention) countExact(ns, n string) int {
	// If NS is wildcard, it must be zero since wildcards only follow exact
	if ns == IntentionWildcard {
		return 0
	}

	// Same reasoning as above, a wildcard can only follow an exact value
	// and an exact value cannot follow a wildcard, so if name is a wildcard
	// we must have exactly one.
	if n == IntentionWildcard {
		return 1
	}

	return 2
}
71086
func (ps *PrefixScanner) Count() (count int, err error) {
	pre := ps.Prefix
	err = ps.db.View(func(tx *bolt.Tx) error {
		c := tx.Bucket(ps.BucketName).Cursor()
		for k, _ := c.Seek(pre); bytes.HasPrefix(k, pre); k, _ = c.Next() {
			count++
		}
		return nil
	})
	if err != nil {
		return count, err
	}
	return count, err
}
899849
func (mp *TxPool) Count() int {
	mp.mtx.RLock()
	count := len(mp.pool)
	mp.mtx.RUnlock()

	return count
}
397522
func (tx *Tx) NamedExecContext(ctx context.Context, query string, arg interface{}) (sql.Result, error) {
	return NamedExecContext(ctx, tx, query, arg)
}
313290
func (c *ReactionsListCall) Count(count int) *ReactionsListCall {
	c.count = count
	return c
}
1289957
func NamedExecContext(ctx context.Context, e ExtContext, query string, arg interface{}) (sql.Result, error) {
	q, args, err := bindNamedMapper(BindType(e.DriverName()), query, arg, mapperFor(e))
	if err != nil {
		return nil, err
	}
	return e.ExecContext(ctx, q, args...)
}
418907
func (t *PEP425Tag) Count() (v int) {
	if t.HasABI() {
		v++
	}
	if t.AnyPlatform() {
		v++
	}
	return
}
297342
func (me *Dataset) CountContext(ctx context.Context) (int64, error) {
	var count int64
	_, err := me.Select(COUNT(Star()).As("count")).ScanValContext(ctx, &count)
	return count, err
}
589578
func (c *statsClient) Count(name string, value int64, rate float64) {
	if err := c.client.Count(prefix+name, value, c.tags, rate); err != nil {
		c.logger.Printf("statsd.StatsClient.Count error: %s", err)
	}
}
796350
func (c *expvarStatsClient) CountWithCustomTags(name string, value int64, rate float64, tags []string) {
	c.m.Add(name, value)
}
1159208
func (info *regexpInfo) addExact() {
	if info.exact.have() {
		info.match = info.match.andTrigrams(info.exact)
	}
}
237182
func (c *Context) GetExtension(name string) *js.Object {
	return c.Call("getExtension", name)
}
262674
func CountCreditDebitRowsCompact(rows []dbtypes.AddressRowCompact) (numCredit, numDebit int) {
	for i := range rows {
		if rows[i].IsFunding {
			numCredit++
		} else {
			numDebit++
		}
	}
	return
}
800548
func CountValues(b []byte) (int, error) {
	i := 0
	for ; len(b) > 0; i++ {
		_, tagsize, size, err := readKind(b)
		if err != nil {
			return 0, err
		}
		b = b[tagsize+size:]
	}
	return i, nil
}
615325
func (q *Qbs) Count(table interface{}) int64 {
	quotedTable := q.Dialect.quote(tableName(table))
	query := "SELECT COUNT(*) FROM " + quotedTable
	var row *sql.Row
	if q.criteria.condition != nil {
		conditionSql, args := q.criteria.condition.Merge()
		query += " WHERE " + conditionSql
		row = q.QueryRow(query, args...)
	} else {
		row = q.QueryRow(query)
	}
	var count int64
	err := row.Scan(&count)
	if err == sql.ErrNoRows {
		return 0
	} else if err != nil {
		q.updateTxError(err)
	}
	return count
}
293704
func Count(name string, value float32, tags map[string]string, opts ...SampleOption) *SSFSample {
	return create(&SSFSample{
		Metric:     SSFSample_COUNTER,
		Name:       name,
		Value:      value,
		Tags:       tags,
		SampleRate: 1.0,
	}, opts)
}
1051978
func IsExactMatch(patTypes []byte) bool {
	for _, pt := range patTypes {
		if pt != patMatch {
			return false
		}
	}
	return true
}