// PredictStorageAvailability provides a mock function with given fields: ctx, lookahead
763091
func (_m *FacadeInterface) PredictStorageAvailability(ctx datastore.Context, lookahead time.Duration) (map[string]float64, error) {
	ret := _m.Called(ctx, lookahead)

	var r0 map[string]float64
	if rf, ok := ret.Get(0).(func(datastore.Context, time.Duration) map[string]float64); ok {
		r0 = rf(ctx, lookahead)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(map[string]float64)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(datastore.Context, time.Duration) error); ok {
		r1 = rf(ctx, lookahead)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
865503
func (env *environ) DeriveAvailabilityZones(ctx context.ProviderCallContext, args environs.StartInstanceParams) ([]string, error) {
	return nil, nil
}
1067630
func NewStorage(file string) (sorted.KeyValue, error) {
	return newKeyValueFromJSONConfig(jsonconfig.Obj{"file": file})
}
761254
func (r Virtual_ReservedCapacityGroup) GetAvailableInstances() (resp []datatypes.Virtual_ReservedCapacityGroup_Instance, err error) {
	err = r.Session.DoRequest("SoftLayer_Virtual_ReservedCapacityGroup", "getAvailableInstances", nil, &r.Options, &resp)
	return
}
504596
func NewStorageWithOptions(fs billy.Filesystem, cache cache.Object, ops Options) *Storage {
	dirOps := dotgit.Options{
		ExclusiveAccess: ops.ExclusiveAccess,
	}
	dir := dotgit.NewWithOptions(fs, dirOps)

	return &Storage{
		fs:  fs,
		dir: dir,

		ObjectStorage:    *NewObjectStorageWithOptions(dir, cache, ops),
		ReferenceStorage: ReferenceStorage{dir: dir},
		IndexStorage:     IndexStorage{dir: dir},
		ShallowStorage:   ShallowStorage{dir: dir},
		ConfigStorage:    ConfigStorage{dir: dir},
		ModuleStorage:    ModuleStorage{dir: dir},
	}
}
382991
func (r Product_Order) CheckItemAvailability(itemPrices []datatypes.Product_Item_Price, accountId *int, availabilityTypeKeyNames []string) (resp bool, err error) {
	params := []interface{}{
		itemPrices,
		accountId,
		availabilityTypeKeyNames,
	}
	err = r.Session.DoRequest("SoftLayer_Product_Order", "checkItemAvailability", params, &r.Options, &resp)
	return
}
837649
func (c *idCache) leaseAvailableID() ID {
	id := c.allocateID()
	if id == NoID {
		return NoID
	}

	// Mark as leased
	c.leased[id] = struct{}{}

	return id
}
1363146
func NewStochRsiWithoutStorage(timePeriod int, fastKTimePeriod int, fastDTimePeriod int, valueAvailableAction ValueAvailableActionStoch) (indicator *StochRsiWithoutStorage, err error) {

	// an indicator without storage MUST have a value available action
	if valueAvailableAction == nil {
		return nil, ErrValueAvailableActionIsNil
	}

	// the minimum timeperiod for this indicator is 2
	if timePeriod < 2 {
		return nil, errors.New("timePeriod is less than the minimum (2)")
	}

	// check the maximum timeperiod
	if timePeriod > MaximumLookbackPeriod {
		return nil, errors.New("timePeriod is greater than the maximum (100000)")
	}

	// the minimum fastKTimePeriod for this indicator is 1
	if fastKTimePeriod < 1 {
		return nil, errors.New("fastKTimePeriod is less than the minimum (1)")
	}

	// check the maximum fastKTimePeriod
	if fastKTimePeriod > MaximumLookbackPeriod {
		return nil, errors.New("fastKTimePeriod is greater than the maximum (100000)")
	}

	// the minimum fastDTimePeriod for this indicator is 1
	if fastDTimePeriod < 1 {
		return nil, errors.New("fastDTimePeriod is less than the minimum (1)")
	}

	// check the maximum fastDTimePeriod
	if fastDTimePeriod > MaximumLookbackPeriod {
		return nil, errors.New("fastDTimePeriod is greater than the maximum (100000)")
	}

	ind := StochRsiWithoutStorage{
		currentFastDMA: 0.0,
		periodCounter:  (fastKTimePeriod * -1),
	}

	tmpRSI, err := NewRsiWithoutStorage(timePeriod, func(dataItem float64, streamBarIndex int) {
		ind.periodCounter += 1

		ind.currentRSI = dataItem
		ind.hhv.ReceiveTick(dataItem, streamBarIndex)
		ind.llv.ReceiveTick(dataItem, streamBarIndex)

		if ind.periodCounter >= 0 {
			diff := ind.currentPeriodHigh - ind.currentPeriodLow
			if diff != 0 {
				ind.currentFastK = 100.0 * ((ind.currentRSI - ind.currentPeriodLow) / diff)
			} else {
				ind.currentFastK = 0
			}
			ind.fastDMA.ReceiveTick(ind.currentFastK, streamBarIndex)
		}
	})

	tmpFastDMA, err := NewSmaWithoutStorage(fastDTimePeriod, func(dataItem float64, streamBarIndex int) {
		ind.currentFastDMA = dataItem

		ind.UpdateIndicatorWithNewValue(ind.currentFastK, ind.currentFastDMA, streamBarIndex)
	})

	totalTimePeriod := tmpRSI.GetLookbackPeriod() + tmpFastDMA.GetLookbackPeriod() + fastKTimePeriod - 1

	ind.baseIndicatorWithFloatBoundsStoch = newBaseIndicatorWithFloatBoundsStoch(totalTimePeriod, valueAvailableAction)
	ind.fastDMA = tmpFastDMA
	ind.rsi = tmpRSI
	ind.hhv, err = NewHhvWithoutStorage(fastKTimePeriod, func(dataItem float64, streamBarIndex int) {
		ind.currentPeriodHigh = dataItem
	})
	ind.llv, err = NewLlvWithoutStorage(fastKTimePeriod, func(dataItem float64, streamBarIndex int) {
		ind.currentPeriodLow = dataItem
	})

	return &ind, err
}
1270706
func (s *persistentStorage) lookup(c context.Context, identity *ProjectIdentity) (*ProjectIdentity, error) {
	logging.Debugf(c, "lookup project scoped identity %v", identity)
	tmp := *identity
	if err := ds.Get(c, &tmp); err != nil {
		switch {
		case err == ds.ErrNoSuchEntity:
			return nil, ErrNotFound
		case err != nil:
			return nil, transient.Tag.Apply(err)
		}
	}
	return &tmp, nil
}
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)
}
425028
func (i *info) MarkAvailable() {
	i.m.Lock()
	ch := i.available
	i.available = nil
	close(ch)
	i.m.Unlock()
}
248341
func (s *RateLimitedStorage) Get(key interface{}) (interface{}, error) {
	s.wait()
	defer s.signal()

	return s.storage.Get(key)
}
870794
func HasStorageBackend(ctx context.Context) bool {
	_, ok := ctx.Value(ctxKeyStorageBackend).(StorageBackend)
	return ok
}
761850
func (a *Allocator) selectAvailableID() (idpool.ID, string, idpool.ID) {
	if id := a.idPool.LeaseAvailableID(); id != idpool.NoID {
		unmaskedID := id
		id |= a.prefixMask
		return id, id.String(), unmaskedID
	}

	return 0, "", 0
}
1102461
func (c *CookbookService) GetAvailableVersions(name, numVersions string) (data CookbookListResult, err error) {
	path := versionParams(fmt.Sprintf("cookbooks/%s", name), numVersions)
	err = c.client.magicRequestDecoder("GET", path, nil, &data)
	return
}
399691
func (c *defConfigBackend) Lookup(key string) (interface{}, bool) {
	value := c.configViper.Get(key)
	if value == nil {
		return nil, false
	}
	return value, true
}
849234
func (az *Cloud) getAvailabilitySetID(resourceGroup, availabilitySetName string) string {
	return fmt.Sprintf(
		availabilitySetIDTemplate,
		az.SubscriptionID,
		resourceGroup,
		availabilitySetName)
}