// RepeatOpt is like Repeat but with more options
//
// Only expects PlayOptions.DeviceID, all other options will be ignored.
489526
func (c *Client) RepeatOpt(state string, opt *PlayOptions) error {
	return c.playerFuncWithOpt(
		"me/player/repeat",
		url.Values{
			"state": []string{state},
		},
		opt,
	)
}
563232
func (c *Client) ShuffleOpt(shuffle bool, opt *PlayOptions) error {
	return c.playerFuncWithOpt(
		"me/player/shuffle",
		url.Values{
			"state": []string{strconv.FormatBool(shuffle)},
		},
		opt,
	)
}
597227
func (mod *CricketBee) ReloadOptions(options bees.BeeOptions) {
	mod.SetOptions(options)
	options.Bind("favourite_team", &mod.favTeam)
}
1066999
func (c *Client) Repeat(state string) error {
	return c.RepeatOpt(state, nil)
}
963260
func (opt *ThrottledeviceOpt) String() string {
	var out []string
	for _, v := range opt.values {
		out = append(out, v.String())
	}

	return fmt.Sprintf("%v", out)
}
435965
func RocksOpts(options *Options) *rocks.Options {

	if options == nil {
		m := make(Options)
		options = &m
	}

	// ToDo
	env := rocks.NewDefaultEnv()

	if n, ok := options.IntKey("background_threads"); ok {
		env.SetBackgroundThreads(n)
		log.Printf("config env.SetBackgroundThreads(%d)\n", n)
	}

	if n, ok := options.IntKey("high_priority_background_threads"); ok {
		env.SetHighPriorityBackgroundThreads(n)
		log.Printf("config env.SetHighPriorityBackgroundThreads(%d)\n", n)
	}

	opts := rocks.NewOptions()
	opts.SetEnv(env)

	if b, ok := options.BoolKey("read_only"); ok {
		opts.SetReadOnly(b)
		log.Printf("config opts.SetReadOnly(%v)\n", b)
	}

	cacheSize := DefaultCacheSize
	if n, ok := options.IntKey("cache_size"); ok {
		cacheSize = n
	}
	cache := rocks.NewLRUCache(cacheSize)
	opts.SetCache(cache)

	// opts.SetComparator(cmp)
	opts.SetErrorIfExists(false)

	if n, ok := options.IntKey("increase_parallelism"); ok {
		opts.IncreaseParallelism(n)
		log.Printf("config opts.IncreaseParallelism(%d)\n", n)
	}

	if b, ok := options.BoolKey("disable_data_sync"); ok {
		opts.SetDisableDataSync(b)
		log.Printf("config opts.SetDisableDataSync(%v)\n", b)
	}

	if n, ok := options.IntKey("bytes_per_sync_power"); ok {
		opts.SetBytesPerSync(uint64(1) << uint64(n))
		log.Printf("config opts.SetBytesPerSync(%d)\n", uint64(1)<<uint64(n))
	}

	if n, ok := options.IntKey("log_level"); ok {
		opts.SetLogLevel(n)
		log.Printf("config opts.SetLogLevel(%d)\n", n)
	}

	if dir, ok := options.StringKey("log_dir"); ok {
		opts.SetLogDir(dir)
		log.Printf("config opts.SetLogDir(%s)\n", dir)
	}

	if dir, ok := options.StringKey("wal_dir"); ok {
		opts.SetLogDir(dir)
		log.Printf("config opts.SetWalDir(%s)\n", dir)
	}

	if n, ok := options.IntKey("stats_dump_period"); ok {
		opts.SetStatsDumpPeriod(uint(n))
		log.Printf("config opts.SetStatsDumpPeriod(%d)\n", n)
	}

	if n, ok := options.IntKey("write_buffer_size"); ok {
		opts.SetWriteBufferSize(n)
		log.Printf("config opts.SetWriteBufferSize(%d)\n", n)
	}

	if n, ok := options.IntKey("write_buffer_size_power"); ok {
		opts.SetWriteBufferSize(int(uint64(1) << uint64(n)))
		log.Printf("config opts.SetWriteBufferSize(%d)\n", int(uint64(1)<<uint(n)))
	}

	if b, ok := options.BoolKey("paranoid_checks"); ok {
		opts.SetParanoidChecks(b)
		log.Printf("config opts.SetParanoidChecks(%v)\n", b)
	}

	if b, ok := options.BoolKey("allow_mmap_reads"); ok {
		opts.SetAllowMMapReads(b)
		log.Printf("config opts.SetAllowMMapReads(%v)\n", b)
	}

	if b, ok := options.BoolKey("allow_mmap_writes"); ok {
		opts.SetAllowMMapWrites(b)
		log.Printf("config opts.SetAllowMMapWrites(%v)\n", b)
	}

	if b, ok := options.BoolKey("allow_os_buffer"); ok {
		opts.SetAllowOSBuffer(b)
		log.Printf("config opts.SetAllowOSBuffer(%v)\n", b)
	}

	if n, ok := options.IntKey("max_open_files"); ok {
		opts.SetMaxOpenFiles(n)
		log.Printf("config opts.SetMaxOpenFiles(%d)\n", n)
	}

	if n, ok := options.IntKey("max_write_buffer_number"); ok {
		opts.SetMaxWriteBufferNumber(n)
		log.Printf("config opts.SetMaxWriteBufferNumber(%d)\n", n)
	}

	if n, ok := options.IntKey("min_write_buffer_number_to_merge"); ok {
		opts.SetMinWriteBufferNumberToMerge(n)
		log.Printf("config opts.SetMinWriteBufferNumberToMerge(%d)\n", n)
	}

	// if n, ok := options.IntKey("block_size"); ok {
	// 	opts.SetBlockSize(n)
	// 	log.Printf("config opts.SetBlockSize(%d)\n", n)
	// }

	// if n, ok := options.IntKey("block_restart_interval"); ok {
	// 	opts.SetBlockRestartInterval(n)
	// 	log.Printf("config opts.SetBlockRestartInterval(%d)\n", n)
	// }

	// Compaction

	if n, ok := options.IntKey("num_levels"); ok {
		opts.SetNumLevels(n)
		log.Printf("config opts.SetNumLevels(%d)\n", n)
	}

	if n, ok := options.IntKey("level0_num_file_compaction_trigger"); ok {
		opts.SetLevel0FileNumCompactionTrigger(n)
		log.Printf("config opts.SetLevel0FileNumCompactionTrigger(%d)\n", n)
	}

	if n, ok := options.IntKey("target_file_size_base_power"); ok {
		opts.SetTargetFileSizeBase(uint64(1) << uint64(n))
		log.Printf("config opts.SetTargetFileSizeBase(%d)\n", uint64(1)<<uint64(n))
	}

	if n, ok := options.IntKey("target_file_size_multiplier"); ok {
		opts.SetTargetFileSizeMultiplier(n)
		log.Printf("config opts.SetTargetFileSizeMultiplier(%d)\n", n)
	}

	if n, ok := options.IntKey("max_background_compactions"); ok {
		opts.SetMaxBackgroundCompactions(n)
		log.Printf("config opts.SetMaxBackgroundCompactions(%d)\n", n)
	}

	if n, ok := options.IntKey("max_background_flushes"); ok {
		opts.SetMaxBackgroundFlushes(n)
		log.Printf("config opts.SetMaxBackgroundFlushes(%d)\n", n)
	}

	comp, ok := options.StringKey("compression")
	if !ok {
		opts.SetCompression(rocks.NoCompression)
	} else {
		// ToDo: https://github.com/facebook/rocksdb/blob/master/include/rocksdb/c.h#L520-L527
		switch comp {
		case "snappy":
			opts.SetCompression(rocks.SnappyCompression)
		case "none":
			opts.SetCompression(rocks.NoCompression)
		default:
			panic(fmt.Errorf("Bad compression: %s", comp))
			return nil
		}
	}

	opts.SetCreateIfMissing(true)
	opts.SetErrorIfExists(false)

	return opts
}
770748
func (mod *HorizonBoxBee) ReloadOptions(options bees.BeeOptions) {
	mod.SetOptions(options)

	options.Bind("address", &mod.address)
	options.Bind("user", &mod.user)
	options.Bind("password", &mod.password)
	options.Bind("interval", &mod.interval)
}
735050
func RepeatEvent(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "repeatEvent", Listener: listener}
}
184779
func DialOpts(opts *Opts) (*Client, error) {
	var conn net.Conn
	var err error
	if opts.TLS {
		conn, err = tls.Dial("tcp", opts.Addr, opts.TLSConfig)
	} else {
		conn, err = net.DialTimeout("tcp", opts.Addr, 10*time.Second)
	}
	if err != nil {
		return nil, err
	}
	return initClient(conn, opts)
}
307195
func (s *SplunkDestinationConfiguration) SetRetryOptions(v *SplunkRetryOptions) *SplunkDestinationConfiguration {
	s.RetryOptions = v
	return s
}
770721
func Repeat(value interface{}, count int) Query {
	return Query{
		Iterate: func() Iterator {
			index := 0

			return func() (item interface{}, ok bool) {
				if index >= count {
					return nil, false
				}

				item, ok = value, true

				index++
				return
			}
		},
	}
}
116603
func (mod *SimplepushBee) ReloadOptions(options bees.BeeOptions) {
	mod.SetOptions(options)

	options.Bind("key", &mod.key)
	options.Bind("password", &mod.password)
	options.Bind("salt", &mod.salt)
}
1272255
func NewReplayXHRArgs(requestID RequestID) *ReplayXHRArgs {
	args := new(ReplayXHRArgs)
	args.RequestID = requestID
	return args
}
617511
func WithRetryOpts(value retry.Opts) coptions.Opt {
	return func(p coptions.Params) {
		logger.Debug("Checking retryOptsSetter")
		if setter, ok := p.(retryOptsSetter); ok {
			setter.SetSelectionRetryOpts(value)
		}
	}
}
326648
func (s *SplunkDestinationUpdate) SetRetryOptions(v *SplunkRetryOptions) *SplunkDestinationUpdate {
	s.RetryOptions = v
	return s
}
51932
func hostModeOptions(dockerInfo *types.ContainerJSON) *policy.OptionsType {

	options := policy.OptionsType{
		CgroupName: strconv.Itoa(dockerInfo.State.Pid),
		CgroupMark: strconv.FormatUint(cgnetcls.MarkVal(), 10),
	}

	for p := range dockerInfo.Config.ExposedPorts {
		if p.Proto() == "tcp" {
			s, err := portspec.NewPortSpecFromString(p.Port(), nil)
			if err != nil {
				continue
			}

			options.Services = append(options.Services, common.Service{
				Protocol: uint8(6),
				Ports:    s,
			})
		}
	}

	return &options
}
429995
func (s *DeleteWorkGroupInput) SetRecursiveDeleteOption(v bool) *DeleteWorkGroupInput {
	s.RecursiveDeleteOption = &v
	return s
}