//GetAvailableOffsets return an offset response or error
340244
func (b *Broker) GetAvailableOffsets(request *OffsetRequest) (*OffsetResponse, error) {
	response := new(OffsetResponse)

	err := b.sendAndReceive(request, response)

	if err != nil {
		return nil, err
	}

	return response, nil
}
731898
func ListAvailableIPs(nwCfg *mastercfg.CfgNetworkState) string {
	return netutils.ListAvailableIPs(nwCfg.IPAllocMap, nwCfg.SubnetIP, nwCfg.SubnetLen)
}
950826
func getNewJoinKeysByOffsets(oldJoinKeys []*expression.Column, offsets []int) []*expression.Column {
	newKeys := make([]*expression.Column, 0, len(oldJoinKeys))
	for _, offset := range offsets {
		newKeys = append(newKeys, oldJoinKeys[offset])
	}
	for pos, key := range oldJoinKeys {
		isExist := false
		for _, p := range offsets {
			if p == pos {
				isExist = true
				break
			}
		}
		if !isExist {
			newKeys = append(newKeys, key)
		}
	}
	return newKeys
}
1031260
func (p *PdfDictionaryObj) GetOffset(glyph int) int {
	ttfp := p.PtrToSubsetFontObj.GetTTFParser()
	glyf := ttfp.GetTables()["glyf"]
	offset := int(glyf.Offset + ttfp.LocaTable[glyph])
	return offset
}
51749
func (r *reader) waitAvailable(pos, wanted int64, ctxErr *error) (avail int64) {
	r.t.cl.lock()
	defer r.t.cl.unlock()
	for !r.readable(pos) && *ctxErr == nil {
		r.waitReadable(pos)
	}
	return r.available(pos, wanted)
}
771518
func (e *Environ) DeriveAvailabilityZones(ctx envcontext.ProviderCallContext, args environs.StartInstanceParams) ([]string, error) {
	return nil, nil
}
435789
func (surface *Surface) GetDeviceOffset() (float64, float64) {
	var xOffset C.double
	var yOffset C.double

	C.cairo_surface_get_device_offset(surface.Ptr, &xOffset, &yOffset)
	if err := surface.status(); err != nil {
		panic(err)
	}
	return float64(xOffset), float64(yOffset)
}
743759
func (s *IncreaseReplicationFactorInput) SetAvailabilityZones(v []*string) *IncreaseReplicationFactorInput {
	s.AvailabilityZones = v
	return s
}
579215
func (sc *stateCheckpoint) GetCPUAssignments() ContainerCPUAssignments {
	sc.mux.RLock()
	defer sc.mux.RUnlock()

	return sc.cache.GetCPUAssignments()
}
1370384
func checkIfAvailable(head *sequence, ordinal uint64) (uint64, uint64, error) {
	bytePos, bitPos := ordinalToPos(ordinal)

	// Find the sequence containing this byte
	current, _, _, inBlockBytePos := findSequence(head, bytePos)
	if current != nil {
		// Check whether the bit corresponding to the ordinal address is unset
		bitSel := blockFirstBit >> (inBlockBytePos*8 + bitPos)
		if current.block&bitSel == 0 {
			return bytePos, bitPos, nil
		}
	}

	return invalidPos, invalidPos, ErrBitAllocated
}
1132088
func (q *OffsetQueue) GetMaxOffset() uint64 {
	q.Lock()
	v := q.getMaxOffset0()
	q.Unlock()
	return v
}
611851
func (g *Grid) GetOffset() (rows, columns int) {
	return g.rowOffset, g.columnOffset
}
653768
func FindAvailableNetwork(list []*net.IPNet) (*net.IPNet, error) {
	return nil, types.NotImplementedErrorf("not supported on freebsd")
}
1350194
func (s *CreateDBClusterInput) SetAvailabilityZones(v []*string) *CreateDBClusterInput {
	s.AvailabilityZones = v
	return s
}
560767
func (u HubUser) GetAvailableLicenses(ctx context.Context) ([]LicenseDisplay, error) {
	subs, err := u.Client.ListSubscriptions(ctx, u.token, u.User.ID)
	if err != nil {
		return nil, err
	}
	for _, org := range u.Orgs {
		orgSub, err := u.Client.ListSubscriptions(ctx, u.token, org.ID)
		if err != nil {
			return nil, err
		}
		subs = append(subs, orgSub...)
	}

	// Convert the SubscriptionDetails to a more user-friendly type to render in the CLI

	res := []LicenseDisplay{}

	// Filter out expired licenses
	i := 0
	for _, s := range subs {
		if s.State == "active" && s.Expires != nil {
			owner := ""
			if s.DockerID == u.User.ID {
				owner = u.User.Username
			} else {
				ownerOrg, err := u.GetOrgByID(s.DockerID)
				if err == nil {
					owner = ownerOrg.Orgname
				} else {
					owner = "unknown"
					logrus.Debugf("Unable to lookup org ID %s: %s", s.DockerID, err)
				}
			}
			comps := []string{}
			for _, pc := range s.PricingComponents {
				comps = append(comps, fmt.Sprintf("%s:%d", pc.Name, pc.Value))
			}
			res = append(res, LicenseDisplay{
				Subscription:     *s,
				Num:              i,
				Owner:            owner,
				ComponentsString: strings.Join(comps, ","),
			})
			i++
		}
	}

	return res, nil
}
1245778
func getAvailableServiceNames(svcMap map[string]struct{}) string {
	var serviceNames []string
	for key := range svcMap {
		serviceNames = append(serviceNames, strconv.Quote(key))
	}
	// Sort the string array to generate consistent result
	sort.Strings(serviceNames)
	return strings.Join(serviceNames, ", ")
}
455044
func FindAvailableNetwork(list []*net.IPNet) (*net.IPNet, error) {
	// We don't check for an error here, because we don't really care if we
	// can't read /etc/resolv.conf. So instead we skip the append if resolvConf
	// is nil. It either doesn't exist, or we can't read it for some reason.
	var nameservers []string
	if rc, err := resolvconf.Get(); err == nil {
		nameservers = resolvconf.GetNameserversAsCIDR(rc.Content)
	}
	for _, nw := range list {
		if err := CheckNameserverOverlaps(nameservers, nw); err == nil {
			if err := CheckRouteOverlaps(nw); err == nil {
				return nw, nil
			}
		}
	}
	return nil, fmt.Errorf("no available network")
}