// GetCount returns the Count field if it's non-nil, zero value otherwise.
435527
func (t *TrafficData) GetCount() int {
	if t == nil || t.Count == nil {
		return 0
	}
	return *t.Count
}
1260509
func (c *BlobDiskController) getDiskCount(SAName string) (int, error) {
	// if we have it in cache
	if c.accounts[SAName].diskCount != -1 {
		return int(c.accounts[SAName].diskCount), nil
	}

	var err error
	var blobSvc azstorage.BlobStorageClient

	if err = c.ensureDefaultContainer(SAName); err != nil {
		return 0, err
	}

	if blobSvc, err = c.getBlobSvcClient(SAName); err != nil {
		return 0, err
	}
	params := azstorage.ListBlobsParameters{}

	container := blobSvc.GetContainerReference(vhdContainerName)
	response, err := container.ListBlobs(params)
	if err != nil {
		return 0, err
	}
	klog.V(4).Infof("azure-Disk -  refreshed data count for account %s and found %v", SAName, len(response.Blobs))
	c.accounts[SAName].diskCount = int32(len(response.Blobs))

	return int(c.accounts[SAName].diskCount), nil
}
502844
func (s *AutoScaleService) GetCounterByName(name string, opts ...OptionFunc) (*Counter, int, error) {
	id, count, err := s.GetCounterID(name, opts...)
	if err != nil {
		return nil, count, err
	}

	r, count, err := s.GetCounterByID(id, opts...)
	if err != nil {
		return nil, count, err
	}
	return r, count, nil
}
1154329
func (p *PushEventRepository) GetWatchersCount() int {
	if p == nil || p.WatchersCount == nil {
		return 0
	}
	return *p.WatchersCount
}
967355
func (r *GormWorkItemRepository) GetCountsPerIteration(ctx context.Context, spaceID uuid.UUID) (map[string]WICountsPerIteration, error) {
	defer goa.MeasureSince([]string{"goa", "db", "workitem", "getCountsPerIteration"}, time.Now())
	db := r.db.Model(&iteration.Iteration{}).Where("space_id = ?", spaceID)
	if db.Error != nil {
		return nil, errors.NewInternalError(ctx, db.Error)
	}

	wiMap, err := r.getAllIterationWithCounts(ctx, db, spaceID)
	if err != nil {
		return nil, err
	}

	countsMap, err := r.getFinalCountAddingChild(ctx, db, spaceID, wiMap)
	if err != nil {
		return nil, err
	}
	return countsMap, nil
}
88634
func (c *Client) EventCount() (count int, err error) {
	conn := c.Pool.Get()
	defer conn.Close()

	count, err = redis.Int(conn.Do("ZCARD", db.EventsCollection))
	if err != nil {
		return 0, err
	}

	return count, nil
}
177317
func ServiceCount() (count int, err error) {
	err = mgr.Do(func(ctx context.Context, cli *client.Client) (err error) {
		var services []swarm.Service
		if services, err = cli.ServiceList(ctx, types.ServiceListOptions{}); err == nil {
			count = len(services)
		}
		return
	})
	return
}
847377
func (i *Import) GetAuthorsCount() int {
	if i == nil || i.AuthorsCount == nil {
		return 0
	}
	return *i.AuthorsCount
}
998531
func (g *Container) ArrayCount(path ...string) (int, error) {
	if array, ok := g.Search(path...).Data().([]interface{}); ok {
		return len(array), nil
	}
	return 0, ErrNotArray
}
151540
func (t *Team) GetReposCount() int {
	if t == nil || t.ReposCount == nil {
		return 0
	}
	return *t.ReposCount
}
844716
func (t *TrafficClones) GetCount() int {
	if t == nil || t.Count == nil {
		return 0
	}
	return *t.Count
}
366727
func (c *Counter) Get() int {
	c.Lock()
	defer c.Unlock()
	return c.count
}
433854
func (s *LocalSupervisor) ServiceCount() int {
	s.Lock()
	defer s.Unlock()
	return len(s.services)
}
186339
func Count(i interface{}) (int, error) {
	s, err := GetSession()
	if err != nil {
		return 0, err
	}
	defer s.Close()

	coll := GetColl(s, typeName(i))

	return coll.Count()
}
1116161
func (c *Client) ReadingCount() (int, error) {
	conn := c.Pool.Get()
	defer conn.Close()

	count, err := redis.Int(conn.Do("ZCARD", db.ReadingsCollection))
	if err != nil {
		return 0, err
	}

	return count, nil
}
61729
func ExtractCount(s string) (int64, error) {
	s = regexNum.FindString(s)
	if len(s) == 0 {
		return 0, ErrNotFound
	}
	val, err := strconv.ParseInt(s, 10, 64)
	if err != nil {
		return 0, err
	}
	return val, nil
}
1319907
func (s *GetReusableDelegationSetLimitOutput) SetCount(v int64) *GetReusableDelegationSetLimitOutput {
	s.Count = &v
	return s
}