// TooFewItems error for when an array contains too few items
977841
func TooFewItems(name, in string, min int64) *Validation {
	msg := fmt.Sprintf(minItemsFail, name, in, min)
	if in == "" {
		msg = fmt.Sprintf(minItemsFailNoIn, name, min)
	}
	return &Validation{
		code:    MinItemsFailCode,
		Name:    name,
		In:      in,
		message: msg,
	}
}
1033530
func (t *Collection) MaxItem(withValue bool) (*Item, error) {
	return t.store.walk(t, withValue,
		func(n *node) (*nodeLoc, bool) { return &n.right, true })
}
262466
func (m *subMenu) toEvent() (e *EventSubMenu) {
	e = &EventSubMenu{
		ID:     m.id,
		RootID: m.rootID,
	}
	for _, i := range m.items {
		e.Items = append(e.Items, i.toEvent())
	}
	return
}
355991
func (ngram *NGramIndex) countNgrams(inputNgrams []uint32) map[TokenID]int {
	counters := make(map[TokenID]int)
	for _, ngramHash := range inputNgrams {
		ngram.RLock()
		for tok := range ngram.index[ngramHash] {
			counters[tok]++
		}
		ngram.RUnlock()
	}
	return counters
}
510882
func SendItems(w MsgWriter, msgcode uint64, elems ...interface{}) error {
	return Send(w, msgcode, elems)
}
1174804
func (p *Tagger) Stem(a string) (string, error) {
	if p.Stemmer == nil {
		return "", componentUnavailable("stemmer")
	}
	return p.Stemmer.Stem(a)
}
823276
func (c *Client) SMembers(key string) ([]string, error) {
	v, err := c.execWithKey(true, "SMEMBERS", key)
	if err != nil {
		return []string{}, err
	}
	return iface2vstr(v), nil
}
1197963
func (m ConcurrentMap) Items() map[string]interface{} {
	tmp := make(map[string]interface{})

	// Insert items to temporary map.
	for item := range m.IterBuffered() {
		tmp[item.Key] = item.Val
	}

	return tmp
}
1224596
func (wsh *WebsocketHub) MaybeSendTxns(tx *types.MempoolTx) {
	if wsh.addTxToBuffer(tx) {
		// This is called from the event loop, so these sends channel may not be
		// blocking.
		go func() {
			wsh.bufferTickerChan <- tickerSigReset
			wsh.sendBufferChan <- bufferSend
		}()
	}
}
1301227
func (k *Kerl) MustSqueezeTrytes(length int) Trytes {
	return MustTritsToTrytes(k.MustSqueeze(length))
}
799056
func SimpleHashFromByteSlices(items [][]byte) []byte {
	switch len(items) {
	case 0:
		return nil
	case 1:
		return leafHash(items[0])
	default:
		k := getSplitPoint(len(items))
		left := SimpleHashFromByteSlices(items[:k])
		right := SimpleHashFromByteSlices(items[k:])
		return innerHash(left, right)
	}
}
236270
func (e *SimpleEventHandler) AddBytes(b []byte) {
	e.items = append(e.items, b)
	e.levels = append(e.levels, e.current)
}
427076
func countSpentOutputs(block *btcutil.Block) int {
	// Exclude the coinbase transaction since it can't spend anything.
	var numSpent int
	for _, tx := range block.Transactions()[1:] {
		numSpent += len(tx.MsgTx().TxIn)
	}
	return numSpent
}
206521
func (s *SwiftService) NewListSwiftsParams() *ListSwiftsParams {
	p := &ListSwiftsParams{}
	p.p = make(map[string]interface{})
	return p
}
837754
func (q *TransmitLimitedQueue) addItem(cur *limitedBroadcast) {
	_ = q.tq.ReplaceOrInsert(cur)
	if cur.name != "" {
		q.tm[cur.name] = cur
	}
}
664093
func (l *List) AddItems(items ...string) {
	l.items = append(l.items, items...)
}
653615
func MutRowFromValues(vals ...interface{}) MutRow {
	c := &Chunk{columns: make([]*column, 0, len(vals))}
	for _, val := range vals {
		col := makeMutRowColumn(val)
		c.columns = append(c.columns, col)
	}
	return MutRow{c: c}
}