// chooseTrans will choose the word to make a diffForHumans statement
554291
func (t *Translator) chooseTrans(transID, time string) string {
	return strings.Replace(t.resources[transID], ":time", time, 1)
}
1337892
func (o *FuzzyCompletionSuggesterOptions) Transpositions(transpositions bool) *FuzzyCompletionSuggesterOptions {
	o.transpositions = &transpositions
	return o
}
27494
func (lbp *Random) Choose(peers []fab.Peer) (fab.Peer, error) {
	if len(peers) == 0 {
		logger.Warn("No peers to choose from!")
		return nil, nil
	}

	index := rand.Intn(len(peers))
	logger.Debugf("Choosing peer at index %d", index)
	return peers[index], nil
}
432156
func (m MapRouter) Choose(ctx context.Context, req *transport.Request) (transport.HandlerSpec, error) {
	service, procedure, encoding := req.Service, req.Procedure, req.Encoding
	if service == "" {
		service = m.defaultService
	}

	if _, ok := m.serviceNames[service]; !ok {
		return transport.HandlerSpec{},
			yarpcerrors.Newf(yarpcerrors.CodeUnimplemented, "unrecognized service name %q, "+
				"available services: %s", req.Service, getAvailableServiceNames(m.serviceNames))
	}

	// Fully specified combinations of service, procedure, and encoding.
	spe := serviceProcedureEncoding{
		service:   service,
		procedure: procedure,
		encoding:  encoding,
	}
	if procedure, ok := m.serviceProcedureEncodings[spe]; ok {
		return procedure.HandlerSpec, nil
	}

	// Alternately use the original behavior: route all encodings to the same
	// handler.
	sp := serviceProcedure{
		service:   service,
		procedure: procedure,
	}
	if procedure, ok := m.serviceProcedures[sp]; ok {
		return procedure.HandlerSpec, nil
	}

	// Supported procedure, unrecognized encoding.
	if wantEncodings := m.supportedEncodings[sp]; len(wantEncodings) == 1 {
		// To maintain backward compatibility with the error messages provided
		// on the wire (as verified by Crossdock across all language
		// implementations), this routes an invalid encoding to the sole
		// implementation of a procedure.
		// The handler is then responsible for detecting the invalid encoding
		// and providing an error including "failed to decode".
		spe.encoding = transport.Encoding(wantEncodings[0])
		return m.serviceProcedureEncodings[spe].HandlerSpec, nil
	}

	return transport.HandlerSpec{}, yarpcerrors.Newf(yarpcerrors.CodeUnimplemented, "unrecognized procedure %q for service %q", req.Procedure, req.Service)
}
1260544
func (_ENSRegistry *ENSRegistryFilterer) FilterTransfer(opts *bind.FilterOpts, node [][32]byte) (*ENSRegistryTransferIterator, error) {

	var nodeRule []interface{}
	for _, nodeItem := range node {
		nodeRule = append(nodeRule, nodeItem)
	}

	logs, sub, err := _ENSRegistry.contract.FilterLogs(opts, "Transfer", nodeRule)
	if err != nil {
		return nil, err
	}
	return &ENSRegistryTransferIterator{contract: _ENSRegistry.contract, event: "Transfer", logs: logs, sub: sub}, nil
}
798517
func ChoiceString(choices []string) (string, error) {
	var winner string
	length := len(choices)
	i, err := IntRange(0, length)
	winner = choices[i]
	return winner, err
}
191920
func choose(n, k int) int {
	if k == 0 {
		return 1
	} else if n == 0 {
		return 0
	}
	result := float32(n - (k - 1))
	for i := 2; i <= k; i++ {
		result *= float32(n-(k-i)) / float32(i)
	}

	return int(result)
}
1310644
func SelectFromStringsWithDefault(messageToPrint string, defaultValue int, options []string) (string, error) {
	return SelectFromStringsFromReaderWithDefault(messageToPrint, defaultValue, options, os.Stdin)
}
1249035
func NewTransferPoller(setts *account.Settings, filter ReceiveEventFilter, interval time.Duration) *TransferPoller {
	if setts.EventMachine == nil {
		setts.EventMachine = &event.DiscardEventMachine{}
	}
	if filter == nil {
		filter = NewPerTailReceiveEventFilter(true)
	}
	poller := &TransferPoller{
		setts: setts, receiveEventFilter: filter,
	}
	poller.syncTimer = util.NewSyncIntervalTimer(interval, poller.pollTransfers, func(err error) {
		poller.setts.EventMachine.Emit(err, event.EventError)
	})
	return poller
}
880427
func choose(args jet.Arguments) reflect.Value {
	args.RequireNumOfArguments("choose", 2, -1)

	var v reflect.Value
	for i, n := 0, args.NumOfArguments(); i < n; i++ {
		v = args.Get(i)
		if !reflects.IsEmpty(v) {
			return reflects.Indirect(v)
		}
	}
	return reflects.Indirect(v)
}
750619
func (_ENSRegistry *ENSRegistryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
	return _ENSRegistry.Contract.ENSRegistryTransactor.contract.Transfer(opts)
}
257067
func (routes RoutesByDistance) Swap(i, j int) {
	routes[i], routes[j] = routes[j], routes[i]
}
346995
func (r *charRange) choose(rand *rand.Rand) rune {
	count := int64(r.last - r.first)
	return r.first + rune(rand.Int63n(count))
}
791665
func (iter *LimitIterator) nextOption() *RankedNode {
	sourceOption := iter.source.Next()
	if sourceOption == nil && iter.skippedNodeIndex < len(iter.skippedNodes) {
		skippedOption := iter.skippedNodes[iter.skippedNodeIndex]
		iter.skippedNodeIndex += 1
		return skippedOption
	}
	return sourceOption
}
553215
func DecisionTypes() []string {
	ds := make([]string, 0, len(decisionTypes))
	for k := range eventTypes {
		ds = append(ds, k)
	}
	return ds
}
80491
func chooseColor(input string) string {
	var sum uint8

	for _, char := range []byte(input) {
		sum += uint8(char)
	}

	// Seven possible terminal colors
	color := (sum % 7) + 1

	if color == 7 {
		color = 9
	}

	return fmt.Sprintf("\033[3%dm", color)
}
947827
func NewTransactionN(n int) *Transaction {
	return &Transaction{Deltas: make([]Delta, 0, n), deltas: make(map[Delta]struct{}, n)}
}