// TODO: add Get(Constraint) (*Worker, error)
766753
func (c *Controller) WorkerInfos() []client.WorkerInfo {
	workers, err := c.List()
	if err != nil {
		return nil
	}
	out := make([]client.WorkerInfo, 0, len(workers))
	for _, w := range workers {
		out = append(out, client.WorkerInfo{
			ID:        w.ID(),
			Labels:    w.Labels(),
			Platforms: w.Platforms(),
		})
	}
	return out
}
528693
func (c *COWList) Get(index int) interface{} {
	list := c.v.Load().([]interface{})
	return list[index]
}
610158
func (lbc *loadBalancerController) worker() {
	for {
		key, _ := lbc.queue.Get()
		glog.Infof("Sync triggered by service %v", key)
		if err := lbc.sync(false); err != nil {
			glog.Warningf("Requeuing %v because of error: %v", key, err)
			lbc.queue.Add(key)
		}
		lbc.queue.Done(key)
	}
}
1248179
func (pool *Pool) Get(queues ...string) (*Job, error) {
	if len(queues) == 0 {
		return nil, errors.New("expected at least one queue")
	}

	args := []interface{}{
		"GETJOB",
		"TIMEOUT",
		int(pool.conf.Timeout.Nanoseconds() / 1000000),
		"WITHCOUNTERS",
		"FROM",
	}
	for _, arg := range queues {
		args = append(args, arg)
	}

	reply, err := pool.do(args)
	if err != nil {
		return nil, err
	}

	replyArr, ok := reply.([]interface{})
	if !ok || len(replyArr) != 1 {
		return nil, errors.New("unexpected reply #1")
	}
	arr, ok := replyArr[0].([]interface{})
	if !ok || len(arr) != 7 {
		return nil, errors.New("unexpected reply #2")
	}

	job := Job{}

	if bytes, ok := arr[0].([]byte); ok {
		job.Queue = string(bytes)
	} else {
		return nil, errors.New("unexpected reply: queue")
	}

	if bytes, ok := arr[1].([]byte); ok {
		job.ID = string(bytes)
	} else {
		return nil, errors.New("unexpected reply: id")
	}

	if bytes, ok := arr[2].([]byte); ok {
		job.Data = string(bytes)
	} else {
		return nil, errors.New("unexpected reply: data")
	}

	if job.Nacks, ok = arr[4].(int64); !ok {
		return nil, errors.New("unexpected reply: nacks")
	}

	if job.AdditionalDeliveries, ok = arr[6].(int64); !ok {
		return nil, errors.New("unexpected reply: additional-deliveries")
	}

	return &job, nil
}
427998
func Get() (p []byte, err error) {
	stdMu.Lock()
	defer stdMu.Unlock()
	if std == nil {
		std, err = NewProfiler()
		if err != nil {
			return nil, err
		}
	}
	return std.Get()
}
405687
func Get() (p []byte, err error) {
	var l load.LoadAvg
	err = l.Get()
	if err != nil {
		return nil, err
	}
	return Serialize(&l), nil
}
79092
func (c *config) Get(key string, args ...interface{}) (interface{}, error) {
	value, err := c.handler.Get(key, args...)
	c.lastError = err
	c.log(GET, err, toVarArgs(args, key)...)
	return value, err
}
461322
func (p *OPpool) Get() *ObservePersistJob {
	var o *ObservePersistJob
	select {
	case o = <-p.pool:
	default:
		o = &ObservePersistJob{}
	}
	return o
}
1216041
func (chainAsyncResult *ChainAsyncResult) Get(sleepDuration time.Duration) ([]reflect.Value, error) {
	if chainAsyncResult.backend == nil {
		return nil, ErrBackendNotConfigured
	}

	var (
		results []reflect.Value
		err     error
	)

	for _, asyncResult := range chainAsyncResult.asyncResults {
		results, err = asyncResult.Get(sleepDuration)
		if err != nil {
			return nil, err
		}
	}

	return results, err
}
272374
func (eng *engine) Get(table Table, opts ...GetOption) (bool, error) {
	s := eng.newSession()
	defer s.Close()
	action, ok, err := s.get(table, s.applyGetOption(opts), table.TableMeta().Fields()...)
	if err != nil {
		return ok, s.catch("Get: "+action, err)
	}
	return ok, nil
}
1003376
func (c *ConfigEntry) Get(args *structs.ConfigEntryQuery, reply *structs.ConfigEntryResponse) error {
	if done, err := c.srv.forward("ConfigEntry.Get", args, args, reply); done {
		return err
	}
	defer metrics.MeasureSince([]string{"config_entry", "get"}, time.Now())

	// Fetch the ACL token, if any.
	rule, err := c.srv.ResolveToken(args.Token)
	if err != nil {
		return err
	}

	// Create a dummy config entry to check the ACL permissions.
	lookupEntry, err := structs.MakeConfigEntry(args.Kind, args.Name)
	if err != nil {
		return err
	}
	if rule != nil && !lookupEntry.CanRead(rule) {
		return acl.ErrPermissionDenied
	}

	return c.srv.blockingQuery(
		&args.QueryOptions,
		&reply.QueryMeta,
		func(ws memdb.WatchSet, state *state.Store) error {
			index, entry, err := state.ConfigEntry(ws, args.Kind, args.Name)
			if err != nil {
				return err
			}

			reply.Index = index
			if entry == nil {
				return nil
			}

			reply.Entry = entry
			return nil
		})
}
165302
func (b *Backend) Get(ctx context.Context, key string) ([]byte, error) {
	if b.cache == nil && b.prefetch {
		err := b.fetchTree(ctx)
		if err != nil {
			return nil, err
		}
	}

	if b.cache != nil {
		return b.fromCache(ctx, key)
	}

	var opt api.QueryOptions

	kv, _, err := b.client.KV().Get(path.Join(b.prefix, key), opt.WithContext(ctx))
	if err != nil {
		return nil, err
	}

	if kv == nil {
		return nil, backend.ErrNotFound
	}

	return kv.Value, nil
}
775507
func (w *CeleryWorker) GetTask(name string) interface{} {
	w.taskLock.RLock()
	task, ok := w.registeredTasks[name]
	if !ok {
		w.taskLock.RUnlock()
		return nil
	}
	w.taskLock.RUnlock()
	return task
}
528654
func (c *ClusterQuotaReconcilationController) worker() {
	workFunc := func() bool {
		c.workerLock.RLock()
		defer c.workerLock.RUnlock()

		uncastKey, uncastData, quit := c.queue.GetWithData()
		if quit {
			return true
		}
		defer c.queue.Done(uncastKey)

		quotaName := uncastKey.(string)
		quota, err := c.clusterQuotaLister.Get(quotaName)
		if apierrors.IsNotFound(err) {
			c.queue.Forget(uncastKey)
			return false
		}
		if err != nil {
			utilruntime.HandleError(err)
			c.queue.AddWithDataRateLimited(uncastKey, uncastData...)
			return false
		}

		workItems := make([]workItem, 0, len(uncastData))
		for _, dataElement := range uncastData {
			workItems = append(workItems, dataElement.(workItem))
		}
		err, retryItems := c.syncQuotaForNamespaces(quota, workItems)
		if err == nil {
			c.queue.Forget(uncastKey)
			return false
		}
		utilruntime.HandleError(err)

		items := make([]interface{}, 0, len(retryItems))
		for _, item := range retryItems {
			items = append(items, item)
		}
		c.queue.AddWithDataRateLimited(uncastKey, items...)
		return false
	}

	for {
		if quit := workFunc(); quit {
			klog.Infof("resource quota controller worker shutting down")
			return
		}
	}
}
190100
func (g *Goon) Get(dst interface{}) error {
	set := reflect.ValueOf(dst)
	if set.Kind() != reflect.Ptr {
		return fmt.Errorf("goon: expected pointer to a struct, got %#v", dst)
	}
	if !set.CanSet() {
		set = set.Elem()
	}
	dsts := []interface{}{dst}
	if err := g.GetMulti(dsts); err != nil {
		// Look for an embedded error if it's multi
		if me, ok := err.(appengine.MultiError); ok {
			return me[0]
		}
		// Not multi, normal error
		return err
	}
	set.Set(reflect.Indirect(reflect.ValueOf(dsts[0])))
	return nil
}
408803
func (c *LFUCache) Get(key interface{}) (interface{}, error) {
	v, err := c.get(key, false)
	if err == KeyNotFoundError {
		return c.getWithLoader(key, true)
	}
	return v, err
}
124040
func (res *Resource) Get(storage store.Get) {
	res.HandleFuncC(
		pat.Get(patID),
		func(ctx context.Context, w http.ResponseWriter, r *http.Request) {
			res.getHandler(ctx, w, r, storage)
		},
	)

	res.addRoute(get, patID)
}