// RandSource causes f to get values from the given source of randomness.
// Use if you want deterministic fuzzing.
768983
func (f *Fuzzer) RandSource(s rand.Source) *Fuzzer {
	f.r = rand.New(s)
	return f
}
820478
func (c *Context) ShaderSource(shader *js.Object, source string) {
	c.Call("shaderSource", shader, source)
}
958196
func randSeqno(lo keybase1.Seqno, hi keybase1.Seqno) (keybase1.Seqno, error) {
	rangeBig := big.NewInt(int64(hi - lo + 1))
	n, err := rand.Int(rand.Reader, rangeBig)
	if err != nil {
		return keybase1.Seqno(0), err
	}
	return keybase1.Seqno(n.Int64()) + lo, nil
}
247433
func (c *Config) TokenSource(ctx context.Context) oauth2.TokenSource {
	source := &tokenSource{
		ctx:  ctx,
		conf: c,
	}
	return oauth2.ReuseTokenSource(nil, source)
}
20867
func randListenFn(listenAddr string, randPortFn func() (int, error)) (string, error) {
	portIdx := strings.LastIndex(listenAddr, ":") + 1
	if portIdx <= 0 || portIdx >= len(listenAddr) {
		return "", errors.New("invalid listen addr, no port found")
	}
	port, err := randPortFn()
	if err != nil {
		return "", err
	}
	return fmt.Sprintf("%s%d", listenAddr[:portIdx], port), nil
}
937150
func GenerateRandomKey(l int) Key {
	key := make([]byte, l)
	var total int
	for total < l {
		read, _ := rand.Read(key[total:])
		total += read
	}
	return key
}
1270976
func (p *StorageProvider) FilesystemSource(providerConfig *storage.Config) (storage.FilesystemSource, error) {
	p.MethodCall(p, "FilesystemSource", providerConfig)
	if p.FilesystemSourceFunc != nil {
		return p.FilesystemSourceFunc(providerConfig)
	}
	return nil, errors.NotSupportedf("filesystems")
}
1249735
func randUint64(r *rand.Rand) uint64 {
	return uint64(r.Uint32())<<32 | uint64(r.Uint32())
}
823799
func (r *Client) GetDatasource(id uint) (Datasource, error) {
	var (
		raw  []byte
		ds   Datasource
		code int
		err  error
	)
	if raw, code, err = r.get(fmt.Sprintf("api/datasources/%d", id), nil); err != nil {
		return ds, err
	}
	if code != 200 {
		return ds, fmt.Errorf("HTTP error %d: returns %s", code, raw)
	}
	err = json.Unmarshal(raw, &ds)
	return ds, err
}
910845
func parseSource(value string) (source *Source, err error) {
	source = &Source{}
	parts := strings.SplitN(value, "=", 2)
	if len(parts) == 1 {
		f := parts[0]
		source.Alias = strings.SplitN(value, ".", 2)[0]
		if path.Base(f) != f {
			err = errors.Errorf("Invalid datasource (%s). Must provide an alias with files not in working directory", value)
			return nil, err
		}
		source.URL, err = absURL(f)
		if err != nil {
			return nil, err
		}
	} else if len(parts) == 2 {
		source.Alias = parts[0]
		source.URL, err = parseSourceURL(parts[1])
		if err != nil {
			return nil, err
		}
	}

	return source, nil
}
698379
func NewRand(seed string) *rand.Rand {
	var seedInt int64
	if seed != "" {
		crcTable := crc64.MakeTable(crc64.ISO)
		seedInt = int64(crc64.Checksum([]byte(seed), crcTable))
	} else {
		seedInt = time.Now().UnixNano()
	}

	randSource := rand.NewSource(seedInt)
	return rand.New(randSource)
}
67228
func (r *SearchRequest) SearchSource(searchSource *SearchSource) *SearchRequest {
	if searchSource == nil {
		r.searchSource = NewSearchSource()
		return r
	}
	r.searchSource = searchSource
	return r
}
874759
func RandInt(max int) int {
	r := rand.New(rand.NewSource(time.Now().UnixNano()))
	return r.Intn(max)
}
530120
func (c C) Rand2() Input {
	v := (rand.Float32() * 2 * float32(c)) - float32(c)
	return C(float32(math.Trunc(float64(v))))
}
962819
func randUseForPlugin(plugin *dt.Plugin) string {
	if plugin.Config.Usage == nil {
		return ""
	}
	return plugin.Config.Usage[rand.Intn(len(plugin.Config.Usage))]
}
594831
func NewLockedSource(seed int64) *lockedSource {
	return &lockedSource{
		src: rand.NewSource(seed).(rand.Source64),
	}
}
634922
func randUse() string {
	if len(PluginsGo) == 0 {
		return ""
	}
	pluginUses := PluginsGo[rand.Intn(len(PluginsGo))].Usage
	if pluginUses == nil || len(pluginUses) == 0 {
		return ""
	}
	return pluginUses[rand.Intn(len(pluginUses))]
}