// Retrieve The number of instances that are members of this reserved capacity group.
978127
func (r Virtual_ReservedCapacityGroup) GetInstancesCount() (resp uint, err error) {
	err = r.Session.DoRequest("SoftLayer_Virtual_ReservedCapacityGroup", "getInstancesCount", nil, &r.Options, &resp)
	return
}
706105
func (ts *Server) GetShardServingCells(ctx context.Context, si *ShardInfo) (servingCells []string, err error) {
	cells, err := ts.GetCellInfoNames(ctx)
	if err != nil {
		return nil, err
	}

	wg := sync.WaitGroup{}
	rec := concurrency.AllErrorRecorder{}
	servingCells = make([]string, 0)
	var mu sync.Mutex
	for _, cell := range cells {
		wg.Add(1)
		go func(cell, keyspace string) {
			defer wg.Done()
			srvKeyspace, err := ts.GetSrvKeyspace(ctx, cell, si.keyspace)
			switch {
			case err == nil:
				for _, partition := range srvKeyspace.GetPartitions() {
					for _, shardReference := range partition.ShardReferences {
						if shardReference.GetName() == si.ShardName() {
							func() {
								mu.Lock()
								defer mu.Unlock()
								// Check that this cell hasn't been added already
								for _, servingCell := range servingCells {
									if servingCell == cell {
										return
									}
								}
								servingCells = append(servingCells, cell)
							}()
						}
					}
				}
			case IsErrType(err, NoNode):
				// NOOP
				return
			default:
				rec.RecordError(err)
				return
			}
		}(cell, si.Keyspace())
	}
	wg.Wait()
	if rec.HasErrors() {
		return nil, NewError(PartialResult, rec.Error().Error())
	}
	return servingCells, nil
}
597538
func (rp *Ringpop) GetReachableMembers(predicates ...swim.MemberPredicate) ([]string, error) {
	if !rp.Ready() {
		return nil, ErrNotBootstrapped
	}

	members := rp.node.GetReachableMembers(predicates...)

	addresses := make([]string, 0, len(members))
	for _, member := range members {
		addresses = append(addresses, member.Address)
	}
	return addresses, nil
}
1063643
func (s *dumpState) getInstances(ctx context.Context, zone string) (map[string]*compute.Instance, error) {
	s.mutex.Lock()
	defer s.mutex.Unlock()

	if s.instances == nil {
		s.instances = make(map[string]map[string]*compute.Instance)
	}

	if s.instances[zone] != nil {
		return s.instances[zone], nil
	}

	instances := make(map[string]*compute.Instance)
	err := s.cloud.Compute().Instances.List(s.cloud.Project(), zone).Pages(ctx, func(page *compute.InstanceList) error {
		for _, i := range page.Items {
			instances[i.Name] = i
		}
		return nil
	})
	if err != nil {
		return nil, err
	}

	s.instances[zone] = instances
	return instances, nil
}
1150795
func (r Network_Storage_Backup_Evault) GetPermissionsGroups() (resp []datatypes.Network_Storage_Group, err error) {
	err = r.Session.DoRequest("SoftLayer_Network_Storage_Backup_Evault", "getPermissionsGroups", nil, &r.Options, &resp)
	return
}
651363
func (api *Client) GetUserGroups(options ...GetUserGroupsOption) ([]UserGroup, error) {
	return api.GetUserGroupsContext(context.Background(), options...)
}
939277
func (c *GroupsHistoryCall) Count(count int) *GroupsHistoryCall {
	c.count = count
	return c
}
324223
func (this *ZookeeperCoordinator) GetConsumersInGroup(Groupid string) (consumers []string, err error) {
	backoffMultiplier := 1
	for i := 0; i <= this.config.MaxRequestRetries; i++ {
		consumers, err = this.tryGetConsumersInGroup(Groupid)
		if err == nil {
			return
		}
		Tracef(this, "GetConsumersInGroup failed for group %s after %d-th retry", Groupid, i)
		time.Sleep(this.config.RequestBackoff * time.Duration(backoffMultiplier))
		backoffMultiplier++
	}
	return
}
854738
func GetListUsersofGroup(groupID int, offset int, count int) (*ResponseUsersOfGroup, error) {
	data, err := httpclient.GetData(APIURL + "/method/groups.getMembers?group_id=" + strconv.Itoa(groupID) + "&offset=" + strconv.Itoa(offset) + "&count=" + strconv.Itoa(count) + "&fields=last_seen&access_token=" + accessToken + "&v=" + APIVersion)
	if err != nil {
		return nil, err
	}

	var users ResponseUsersOfGroup
	if err := json.Unmarshal(data, &users); err != nil {
		return nil, err
	}
	return &users, nil
}
1043298
func (r Hardware_Server) GetResourceGroups() (resp []datatypes.Resource_Group, err error) {
	err = r.Session.DoRequest("SoftLayer_Hardware_Server", "getResourceGroups", nil, &r.Options, &resp)
	return
}
611498
func (r *PCPRegistry) InstanceCount() int {
	r.indomlock.RLock()
	defer r.indomlock.RUnlock()

	return r.instanceCount
}
755256
func getPreallocatedFSGroup(ns *corev1.Namespace) ([]securityapi.IDRange, error) {
	groups, err := getSupplementalGroupsAnnotation(ns)
	if err != nil {
		return nil, err
	}
	klog.V(4).Infof("got preallocated value for groups: %s in namespace %s", groups, ns.Name)

	blocks, err := parseSupplementalGroupAnnotation(groups)
	if err != nil {
		return nil, err
	}
	return []securityapi.IDRange{
		{
			Min: int64(blocks[0].Start),
			Max: int64(blocks[0].Start),
		},
	}, nil
}
772187
func GetReadyReplicaCountForReplicaSets(replicaSets []*apps.ReplicaSet) int32 {
	totalReadyReplicas := int32(0)
	for _, rs := range replicaSets {
		if rs != nil {
			totalReadyReplicas += rs.Status.ReadyReplicas
		}
	}
	return totalReadyReplicas
}
159365
func (d *driver) getInstance(ctx types.Context) (awsec2.Instance, error) {
	diInput := &awsec2.DescribeInstancesInput{
		InstanceIds: []*string{mustInstanceIDID(ctx)},
	}
	resp, err := mustSession(ctx).DescribeInstances(diInput)
	if err != nil {
		return awsec2.Instance{}, goof.WithError(
			"error retrieving instance with EC2 API call", err)
	}
	return *resp.Reservations[0].Instances[0], nil
}
949499
func getContainerCPUMemory(context *cli.Context, spec *specs.Spec) (cpu int, mem int) {
	if spec.Linux != nil && spec.Linux.Resources != nil {
		resource := spec.Linux.Resources
		if resource.CPU != nil && resource.CPU.Period != nil && resource.CPU.Quota != nil {
			period := *resource.CPU.Period
			quota := *resource.CPU.Quota
			if period > 0 && quota > 0 {
				cpu = int((uint64(quota) + period - 1) / period)
			}
		}
		if resource.Memory != nil && resource.Memory.Limit != nil {
			mem = int(*resource.Memory.Limit >> 20)
		}
	}

	if cpu <= 0 {
		cpu = context.GlobalInt("default_cpus")
	}
	if mem <= 0 {
		mem = context.GlobalInt("default_memory")
	}

	return cpu, mem
}
1054118
func (i *instanceManager) DeviceStats(d *structs.AllocatedDeviceResource) *device.DeviceGroupStats {
	i.deviceStatsLock.RLock()
	defer i.deviceStatsLock.RUnlock()

	// Find the device in question and then gather the instance statistics we
	// are interested in
	for _, group := range i.deviceStats {
		if group.Vendor != d.Vendor || group.Type != d.Type || group.Name != d.Name {
			continue
		}

		// We found the group we want so now grab the instance stats
		out := &device.DeviceGroupStats{
			Vendor:        d.Vendor,
			Type:          d.Type,
			Name:          d.Name,
			InstanceStats: make(map[string]*device.DeviceStats, len(d.DeviceIDs)),
		}

		for _, id := range d.DeviceIDs {
			out.InstanceStats[id] = group.InstanceStats[id]
		}

		return out
	}

	return nil
}
739610
func GetActualReplicaCountForReplicaSets(replicaSets []*apps.ReplicaSet) int32 {
	totalActualReplicas := int32(0)
	for _, rs := range replicaSets {
		if rs != nil {
			totalActualReplicas += rs.Status.Replicas
		}
	}
	return totalActualReplicas
}