// Select wraps syscall.Select with Go types
773855
func Select(n int, r, w, e *FDSet, timeout time.Duration) error {
	var timeval *syscall.Timeval
	if timeout >= 0 {
		t := syscall.NsecToTimeval(timeout.Nanoseconds())
		timeval = &t
	}

	return sysSelect(n, r, w, e, timeval)
}
443100
func (f *fsClient) Select(expression string, sse encrypt.ServerSide, opts SelectObjectOpts) (io.ReadCloser, *probe.Error) {
	return nil, probe.NewError(APINotImplemented{})
}
907840
func (m *MockQuery) Select(arg0 interface{}) mongo.Query {
	ret := m.ctrl.Call(m, "Select", arg0)
	ret0, _ := ret[0].(mongo.Query)
	return ret0
}
904777
func (g *Group) Select() *Statement {
	// notest
	s := Select()
	g.items = append(g.items, s)
	return s
}
980997
func (c ConfigSelector) Select(r *http.Request) (config HandlerConfig) {
	for i := range c {
		if !c[i].Match(r) {
			continue
		}
		if config == nil || len(c[i].BasePath()) > len(config.BasePath()) {
			config = c[i]
		}
	}
	return config
}
1040178
func (b *AnnealingEpsilonGreedy) Select() int {
	if rand.Float64() > b.Epsilon() {
		// Select the maximal value from values.
		max := -1.0
		idx := -1

		// Find the index of the maximal value.
		for i, val := range b.values {
			if val > max {
				max = val
				idx = i
			}
		}

		return idx
	}

	// Otherwise return any of the values
	return rand.Intn(len(b.values))
}
907786
func (tx *Tx) Select(dest interface{}, query string, args ...interface{}) error {
	return Select(tx, dest, query, args...)
}
920887
func (t *Transaction) Select(dest interface{}, query string, args ...interface{}) error {
	return hookedselect(t.dbmap, t, dest, query, args...)
}
288485
func (cb *configBased) Select(aps []AvailablePlugin, id string) (AvailablePlugin, error) {
	if ap, ok := cb.plugins[id]; ok && ap != nil {
		return ap, nil
	}

	// add first one in case it's new id
	for _, ap := range aps {
		available := true
		for _, busyPlugin := range cb.plugins {
			if ap == busyPlugin {
				available = false
			}
		}
		if available {
			cb.plugins[id] = ap
			return ap, nil
		}
	}
	cb.logger.WithFields(log.Fields{
		"_block":   "findAvailablePlugin",
		"strategy": cb.String(),
		"error":    fmt.Sprintf("%v of %v plugins are available", len(aps)-len(cb.plugins), len(aps)),
	}).Error(ErrCouldNotSelect)
	return nil, ErrCouldNotSelect
}
65007
func Select(selections ...Selectable) (stmt SelectStmt) {
	columns := make([]ColumnElem, 0)
	for _, selection := range selections {
		if selection == nil {
			stmt.SetError("aspect: received a nil selectable - do the columns or tables you selected exist?")
			return
		}
		columns = append(columns, selection.Selectable()...)
	}

	if len(columns) < 1 {
		stmt.SetError("aspect: must select at least one column")
		return
	}

	for _, column := range columns {
		// Adding a bad column will pass a zero-initialized ColumnElem and
		// since blank column names are invalid SQL we can reject them
		if column.Name() == "" {
			stmt.SetError("aspect: selected column does not exist")
			return
		}
		stmt.columns = append(stmt.columns, column)

		// Add the table to the stmt tables if it does not already exist
		if !stmt.TableExists(column.Table().Name()) {
			stmt.tables = append(stmt.tables, column.Table())
		}
	}
	return
}
519720
func (m *Miniredis) Select(i int) {
	m.Lock()
	defer m.Unlock()
	m.selectedDB = i
}
209181
func (r *LeastConn) Select(pool HostPool, request *http.Request) *UpstreamHost {
	var bestHost *UpstreamHost
	count := 0
	leastConn := int64(math.MaxInt64)
	for _, host := range pool {
		if !host.Available() {
			continue
		}

		if host.Conns < leastConn {
			leastConn = host.Conns
			count = 0
		}

		// Among hosts with same least connections, perform a reservoir
		// sample: https://en.wikipedia.org/wiki/Reservoir_sampling
		if host.Conns == leastConn {
			count++
			if (rand.Int() % count) == 0 {
				bestHost = host
			}
		}
	}
	return bestHost
}
962949
func Select(list SortSlicer, k int) int {
	var (
		start int
		end   = list.Len()
	)
	if k >= end {
		if k == 0 {
			return 0
		}
		panic("kdtree: index out of range")
	}
	if start == end-1 {
		return k
	}

	for {
		if start == end {
			panic("kdtree: internal inconsistency")
		}
		sub := list.Slice(start, end)
		pivot := Partition(sub, rand.Intn(sub.Len()))
		switch {
		case pivot == k:
			return k
		case k < pivot:
			end = pivot + start
		default:
			k -= pivot
			start += pivot
		}
	}
}
1243916
func (r *IPHash) Select(pool HostPool, request *http.Request) *UpstreamHost {
	clientIP, _, err := net.SplitHostPort(request.RemoteAddr)
	if err != nil {
		clientIP = request.RemoteAddr
	}
	return hostByHashing(pool, clientIP)
}
1064036
func (rev *Revocation) Select(tx *sql.Tx) error {
	row := tx.QueryRow(`SELECT revoked_at, mechanism, reason FROM revocations WHERE ski=?`, rev.SKI)
	err := row.Scan(&rev.RevokedAt, &rev.Mechanism, &rev.Reason)
	if err != nil {
		return err
	}

	return nil
}
343335
func (n *NamedStmt) Select(dest interface{}, arg interface{}) error {
	rows, err := n.Queryx(arg)
	if err != nil {
		return err
	}
	// if something happens here, we want to make sure the rows are Closed
	defer rows.Close()
	return scanAll(rows, dest, false)
}
51238
func (ca Actions) Selection() []string {
	keys := make([]string, 0, len(ca))
	for _, a := range ca {
		keys = append(keys, a.Name)
	}
	return keys
}