// ExtractRates sets the rate extractor
546768
func ExtractRates(e RateExtractor) TokenLimiterOption {
	return func(cl *TokenLimiter) error {
		cl.extractRates = e
		return nil
	}
}
1295996
func (rt *Rates) TotalRate() float64 {
	rt.mu.Lock()
	defer rt.mu.Unlock()

	return rt.totalRate
}
263735
func extractHeader(body io.Reader, myHeaders http.Header) error {
	for {
		// extracts the first part of the header,
		headerTypeName, err := extractHeaderType(body)
		if err != nil {
			// Since end of file, we have read all of our headers
			if err == io.EOF {
				break
			}
			return err
		}

		// reads the 7 present in the header and ignores it.
		extractUint8(body)

		headerValueName, err := extractHeaderValue(body)
		if err != nil {
			return err
		}

		myHeaders.Set(headerTypeName, headerValueName)

	}
	return nil
}
358410
func (z *ZipArchive) ExtractTo(destPath string, entries ...string) (err error) {
	return z.ExtractToFunc(destPath, defaultExtractFunc, entries...)
}
1344287
func ExtractTo(srcPath, destPath string, entries ...string) (err error) {
	return ExtractToFunc(srcPath, destPath, defaultExtractFunc, entries...)
}
462907
func (out OffsetOut) Rate(rate int8) Input {
	CheckRate(rate)
	return NewInput("OffsetOut", rate, 0, 1, out.Bus, out.Channels)
}
291179
func ExtractEnableRules(opts ...interface{}) *opt.EnableRulesOption {
	for _, o := range opts {
		if v, ok := o.(*opt.EnableRulesOption); ok {
			return v
		}
	}
	return nil
}
1145741
func (s *VolumeService) ExtractVolume(p *ExtractVolumeParams) (*ExtractVolumeResponse, error) {
	resp, err := s.cs.newRequest("extractVolume", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r ExtractVolumeResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	// If we have a async client, we need to wait for the async result
	if s.cs.async {
		b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)
		if err != nil {
			if err == AsyncTimeoutErr {
				return &r, err
			}
			return nil, err
		}

		b, err = getRawValue(b)
		if err != nil {
			return nil, err
		}

		if err := json.Unmarshal(b, &r); err != nil {
			return nil, err
		}
	}

	return &r, nil
}
726508
func (l LFGauss) Rate(rate int8) Input {
	CheckRate(rate)
	(&l).defaults()
	done := C(float32(l.Done))
	return NewInput("LFGauss", rate, 0, 1, l.Duration, l.Width, l.IPhase, l.Loop, done)
}
942592
func (rl *RateLimiter) UpdateRate(rate int) {
	atomic.StoreUint64(&rl.rate, uint64(rate))
	atomic.StoreUint64(&rl.max, uint64(rate)*rl.unit)
}
8262
func NewRates(name string, countTracker CountTracker, samples int, interval time.Duration) *Rates {
	if interval < 1*time.Second {
		panic("interval too small")
	}
	rt := &Rates{
		timeStamps:   NewRingInt64(samples + 1),
		counts:       make(map[string]*RingInt64),
		countTracker: countTracker,
		samples:      samples + 1,
		interval:     interval,
	}
	if name != "" {
		Publish(name, rt)
	}
	go rt.track()
	return rt
}
1246380
func (sel Select) Rate(rate int8) Input {
	CheckRate(rate)
	inputs := append([]Input{sel.Which}, sel.Inputs...)
	return NewInput("Select", rate, 0, 1, inputs...)
}
77892
func (xline XLine) Rate(rate int8) Input {
	CheckRate(rate)
	(&xline).defaults()
	return NewInput("XLine", rate, 0, 1, xline.Start, xline.End, xline.Dur, C(float32(xline.Done)))
}
326276
func (lfnoise LFNoise) Rate(rate int8) Input {
	CheckRate(rate)
	(&lfnoise).defaults()
	switch lfnoise.Interpolation {
	case NoiseStep:
		return NewInput("LFNoise0", rate, 0, 1, lfnoise.Freq)
	case NoiseLinear:
		return NewInput("LFNoise1", rate, 0, 1, lfnoise.Freq)
	case NoiseQuadratic:
		return NewInput("LFNoise2", rate, 0, 1, lfnoise.Freq)
	default:
		panic(fmt.Sprintf("Unknown Interpolation value for LFNoise: %d", lfnoise.Interpolation))
	}
}
1207391
func (m Median) Rate(rate int8) Input {
	CheckRate(rate)
	if m.In == nil {
		panic("Median requires an input signal")
	}
	(&m).defaults()
	return NewInput("Median", rate, 0, 1, m.Length, m.In)
}
1055376
func ExtractSumOrFiltersScores(opts ...interface{}) *opt.SumOrFiltersScoresOption {
	for _, o := range opts {
		if v, ok := o.(*opt.SumOrFiltersScoresOption); ok {
			return v
		}
	}
	return nil
}
718453
func (ds DetectSilence) Rate(rate int8) Input {
	if ds.In == nil {
		panic("DetectSilence expects In to not be nil")
	}
	CheckRate(rate)
	(&ds).defaults()
	return NewInput("DetectSilence", rate, 0, 1, ds.In, ds.Amp, ds.Time, C(float32(ds.Done)))
}