// Count returns the number of units contained within the duration.
3959
func (tu Unit) Count(d time.Duration) (int, error) {
	if d < 0 {
		return 0, errNegativeDuraton
	}

	if dur, found := unitsToDuration[tu]; found {
		return int(d / dur), nil
	}

	// Invalid unit.
	return 0, errUnrecognizedTimeUnit
}
483769
func (s *UniformSample) Count() int64 {
	s.mutex.Lock()
	defer s.mutex.Unlock()
	return s.count
}
435245
func (self *Query) Count() (n int, err error) {

	return self.collection.Find(self.query).Count()
}
340471
func (r *Application) Count(count int) *Application {
	r.Instances = &count

	return r
}
1262200
func (t *tmNodeSeq) Count() int {
	if t.cnt < 0 {
		return sequtil.SeqCount(t)
	}
	return t.cnt
}
313290
func (c *ReactionsListCall) Count(count int) *ReactionsListCall {
	c.count = count
	return c
}
1245638
func (me *Dataset) Count() (int64, error) {
	var count int64
	_, err := me.Select(COUNT(Star()).As("count")).ScanVal(&count)
	return count, err
}
679439
func (m *CountMeter) Count() int64 {
	m.mtx.RLock()
	defer m.mtx.RUnlock()
	return m.overall
}
319068
func (query Query) Count() (int, error) {
	var out struct {
		Count int
	}

	err := query.Aggregate("count", "*", &out)
	return out.Count, err
}
435354
func (c *ChannelsHistoryCall) Count(count int) *ChannelsHistoryCall {
	c.count = count
	return c
}
570054
func (kv *KV) Count() (i int) {
	for k := range kv.db.Keys(nil) {
		_, err := kv.db.Read(k)
		if err != nil {
			break
		}
		i++
	}
	return
}
1360826
func (sc *SubscriptionScope) Count() int {
	sc.mu.Lock()
	defer sc.mu.Unlock()
	return len(sc.subs)
}
125036
func Count(v uint64) (int, error) {
	sel := v >> 60
	if sel >= 16 {
		return 0, fmt.Errorf("invalid selector value: %v", sel)
	}
	return selector[sel].n, nil
}
1189613
func (pc *ProbabilisticCounter) Count() int {
	ones := float64(pc.bitset.Count())
	length := float64(pc.bitset.Len())
	zeroes := length - ones
	estimator := -1 * length * math.Log(zeroes/length)
	return int(estimator)
}
1173064
func (r *TasksService) Count() *TasksCountCall {
	c := &TasksCountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	return c
}
1210046
func (s *sender) Count(stat string, count float64, tags ...string) {
	s.c <- fmt.Sprintf("%s:%f|c\n", stat, count)
}
806954
func (t *Timings) Counts() map[string]int64 {
	t.mu.Lock()
	defer t.mu.Unlock()

	counts := make(map[string]int64, len(t.histograms)+1)
	for k, v := range t.histograms {
		counts[k] = v.Count()
	}
	counts["All"] = t.totalCount
	return counts
}