// SetGenerate sets the server to generate coins (mine) or not.
170829
func (c *Client) SetGenerate(enable bool, numCPUs int) error {
	return c.SetGenerateAsync(enable, numCPUs).Receive()
}
526550
func (s *Server) SetDrain(drain drain.LogDrain) {
	// Get an exclusive lock before updating the internal pointer to the log drain.  Other
	// goroutines holding read locks might depend on that pointer as it currently exists.
	s.drainMutex.Lock()
	defer s.drainMutex.Unlock()
	s.drain = drain
}
903842
func handleGetGenerate(s *rpcServer, cmd interface{}, closeChan <-chan struct{}) (interface{}, error) {
	return s.cfg.CPUMiner.IsMining(), nil
}
533712
func (g *Generator) SetVar(varName, varValue string) {
	g.vars[varName] = varValue
}
878300
func (ri UserServerHalfRemovalInfo) addGeneration(
	uid keybase1.UID, genInfo UserServerHalfRemovalInfo) error {
	if ri.UserRemoved != genInfo.UserRemoved {
		return fmt.Errorf(
			"UserRemoved=%t != generation UserRemoved=%t for user %s",
			ri.UserRemoved, genInfo.UserRemoved, uid)
	}

	if len(ri.DeviceServerHalfIDs) != len(genInfo.DeviceServerHalfIDs) {
		return fmt.Errorf(
			"device count=%d != generation device count=%d for user %s",
			len(ri.DeviceServerHalfIDs),
			len(genInfo.DeviceServerHalfIDs), uid)
	}

	idCount := -1
	for key, serverHalfIDs := range genInfo.DeviceServerHalfIDs {
		if idCount == -1 {
			idCount = len(ri.DeviceServerHalfIDs[key])
		} else {
			localIDCount := len(ri.DeviceServerHalfIDs[key])
			if localIDCount != idCount {
				return fmt.Errorf(
					"expected %d keys, got %d for user %s and device %s",
					idCount, localIDCount, uid, key)
			}
		}

		if len(serverHalfIDs) != 1 {
			return fmt.Errorf(
				"expected exactly one key, got %d for user %s and device %s",
				len(serverHalfIDs), uid, key)
		}
		if _, ok := ri.DeviceServerHalfIDs[key]; !ok {
			return fmt.Errorf(
				"no generation info for user %s and device %s",
				uid, key)
		}
		ri.DeviceServerHalfIDs[key] = append(
			ri.DeviceServerHalfIDs[key], serverHalfIDs[0])
	}

	return nil
}
295893
func (b *BlockGen) SetCoinbase(addr common.Address) {
	if b.gasPool != nil {
		if len(b.txs) > 0 {
			panic("coinbase must be set before adding transactions")
		}
		panic("coinbase can only be set once")
	}
	b.header.Coinbase = addr
	b.gasPool = new(GasPool).AddGas(b.header.GasLimit)
}
88515
func (s *Ethereum) SetEtherbase(etherbase common.Address) {
	s.lock.Lock()
	s.etherbase = etherbase
	s.lock.Unlock()

	s.miner.SetEtherbase(etherbase)
}
462101
func (o *CreateNew) SetRetries(v *int) *CreateNew {
	if o.Retries = v; o.Retries == nil {
		o.nullFields = append(o.nullFields, "Retries")
	}
	return o
}
819686
func (g StaticKeyGenerate) KeyGenerate() (ByteSource, error) {
	buf := make([]byte, g.KeySize())
	copy(buf, g)
	return ByteKey(buf), nil
}
805601
func (s *RefreshCacheInput) SetRecursive(v bool) *RefreshCacheInput {
	s.Recursive = &v
	return s
}
961516
func (c *LoggerCollection) SetLevel(re *regexp.Regexp, level LogLevel) {
	c.mtx.Lock()
	defer c.mtx.Unlock()

	if re == nil {
		c.level = level
	}
	for name, logger := range c.loggers {
		if re == nil || re.MatchString(name) {
			logger.setLevel(level)
		}
	}
}
928859
func (c *Client) SetRetries(count int) {
	if count < 1 {
		c.retries = defaultRetries
	}
	c.retries = count
}
1215820
func (s *GetSegmentVersionsInput) SetToken(v string) *GetSegmentVersionsInput {
	s.Token = &v
	return s
}
246319
func (a *GetPropertiesArgs) SetGeneratePreview(generatePreview bool) *GetPropertiesArgs {
	a.GeneratePreview = &generatePreview
	return a
}
95146
func (g *Generator) generateSetters(mc *msgCtx, topLevelFields []topLevelField) {
	for _, pf := range topLevelFields {
		pf.setter(g, mc)
	}
}
1349527
func (info ServerHalfRemovalInfo) AddGeneration(
	genInfo ServerHalfRemovalInfo) error {
	if len(info) != len(genInfo) {
		return fmt.Errorf(
			"user count=%d != generation user count=%d",
			len(info), len(genInfo))
	}

	for uid, removalInfo := range genInfo {
		if _, ok := info[uid]; !ok {
			return fmt.Errorf("no generation info for user %s", uid)
		}
		err := info[uid].addGeneration(uid, removalInfo)
		if err != nil {
			return err
		}
	}
	return nil
}
904693
func (s *Voice) SetGender(v string) *Voice {
	s.Gender = &v
	return s
}