/*AroOnOsc - Aroon Oscillator

Input = High, Low

Output = double

Optional Parameters

-------------------

optInTimePeriod:(From 2 to 100000)

Number of period

*/
432660
func AroOnOsc(high, low []float64, timePeriod int32) []float64 {
	var outBegIdx C.int
	var outNBElement C.int
	outReal := make([]float64, len(high))
	C.TA_AROONOSC(0, C.int(len(high)-1), (*C.double)(unsafe.Pointer(&high[0])), (*C.double)(unsafe.Pointer(&low[0])), C.int(timePeriod), &outBegIdx, &outNBElement, (*C.double)(unsafe.Pointer(&outReal[0])))
	return outReal[:outNBElement]
}
190927
func RatioClock(clock timetools.TimeProvider) ratioOptSetter {
	return func(r *RatioCounter) error {
		r.clock = clock
		return nil
	}
}
967379
func OptServerMetricInterval(dur time.Duration) ServerOption {
	return func(s *Server) error {
		s.metricInterval = dur
		return nil
	}
}
996227
func parseGracePeriods(statements map[string]string) (map[evictionapi.Signal]time.Duration, error) {
	if len(statements) == 0 {
		return nil, nil
	}
	results := map[evictionapi.Signal]time.Duration{}
	for signal, val := range statements {
		signal := evictionapi.Signal(signal)
		if !validSignal(signal) {
			return nil, fmt.Errorf(unsupportedEvictionSignal, signal)
		}
		gracePeriod, err := time.ParseDuration(val)
		if err != nil {
			return nil, err
		}
		if gracePeriod < 0 {
			return nil, fmt.Errorf("invalid eviction grace period specified: %v, must be a positive value", val)
		}
		results[signal] = gracePeriod
	}
	return results, nil
}
283753
func OptServerAntiEntropyInterval(interval time.Duration) ServerOption {
	return func(s *Server) error {
		s.antiEntropyInterval = interval
		return nil
	}
}
875073
func PingPeriod(pingPeriod time.Duration) func(*WSClient) {
	return func(c *WSClient) {
		c.pingPeriod = pingPeriod
	}
}
1230188
func RTMOptionPingInterval(d time.Duration) RTMOption {
	return func(rtm *RTM) {
		rtm.pingInterval = d
		rtm.resetDeadman()
	}
}
86205
func ParsePeriodic(start, duration string) (*Periodic, error) {
	var err error

	pc := &Periodic{}

	if pc.start, err = parseStart(start); err != nil {
		return nil, fmt.Errorf("unable to parse start: %v", err)
	}

	if pc.duration, err = time.ParseDuration(duration); err != nil {
		return nil, fmt.Errorf("unable to parse duration: %v", err)
	}

	if pc.duration < time.Duration(0) {
		return nil, fmt.Errorf("duration cannot be negative")
	}

	// check that the duration of the window does not exceed the period.
	if (pc.start.dayOfWeek == -1 && pc.duration >= 24*time.Hour) || pc.duration >= 7*24*time.Hour {
		return nil, fmt.Errorf("duration cannot exceed period")
	}

	return pc, nil
}
1356220
func (s *GetCostAndUsageInput) SetTimePeriod(v *DateInterval) *GetCostAndUsageInput {
	s.TimePeriod = v
	return s
}
840259
func (d DateTime) TimePeriod(v reflect.Value) (interface{}, error) {
	return d.period(), nil
}
139620
func (s *HlsGroupSettings) SetProgramDateTimePeriod(v int64) *HlsGroupSettings {
	s.ProgramDateTimePeriod = &v
	return s
}
354636
func Min(real []float64, timePeriod int32) []float64 {
	var outBegIdx C.int
	var outNBElement C.int
	outReal := make([]float64, len(real))
	C.TA_MIN(0, C.int(len(real)-1), (*C.double)(unsafe.Pointer(&real[0])), C.int(timePeriod), &outBegIdx, &outNBElement, (*C.double)(unsafe.Pointer(&outReal[0])))
	return outReal[:outNBElement]
}
840118
func (s *MetricAlarm) SetPeriod(v int64) *MetricAlarm {
	s.Period = &v
	return s
}
1246860
func (m *MultiLRUCache) SetExpireGracePeriod(p time.Duration) {
	for _, c := range m.cache {
		c.ExpireGracePeriod = p
	}
}
1089528
func (o *Osc) SetFreq(hz float64) {
	if o.Freq != hz {
		o.Freq = hz
		o.phaseAngleIncr = ((hz * TwoPi) / float64(o.Fs))
	}
}
115172
func MidPoint(real []float64, timePeriod int32) []float64 {
	var outBegIdx C.int
	var outNBElement C.int
	outReal := make([]float64, len(real))
	C.TA_MIDPOINT(0, C.int(len(real)-1), (*C.double)(unsafe.Pointer(&real[0])), C.int(timePeriod), &outBegIdx, &outNBElement, (*C.double)(unsafe.Pointer(&outReal[0])))
	return outReal[:outNBElement]
}
337999
func PingPeriod(pingPeriod time.Duration) func(*wsConnection) {
	return func(wsc *wsConnection) {
		wsc.pingPeriod = pingPeriod
	}
}