// Get is shorthand for calling the e.Load(), and then returning
// `e.env.GetAll(key)`.
500766
func (e *delayedEnvironment) GetAll(key string) []string {
	e.Load()
	return e.env.GetAll(key)
}
1217787
func Get() (p []byte, err error) {
	var l load.LoadAvg
	err = l.Get()
	if err != nil {
		return nil, err
	}
	return json.Marshal(&l)
}
1002521
func (l *Lazy) Get(key string) (interface{}, bool, error) {
	l.init()
	if l.initErr != nil {
		return nil, false, l.initErr
	}
	v, found := l.cache[key]
	return v, found, 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
}
811773
func (c *CMap) Get(key interface{}) (val interface{}) {
	c.mutex.RLock()
	val = c.items[key]
	c.mutex.RUnlock()
	return
}
451462
func (s *GenericStorage) Get(key interface{}) (interface{}, error) {
	if s.get == nil && s.getMulti == nil {
		return nil, errors.Newf(
			"'%s' does not have Get/GetMulti implementation",
			s.name)
	}

	s.rwMutex.RLock()
	defer s.rwMutex.RUnlock()

	if s.get != nil {
		return s.get(key)
	}

	items, err := s.getMulti(key)
	if err != nil {
		return nil, err
	}
	return items[0], nil
}
99932
func (env *TypeEnv) Get(x interface{}) types.Type {

	if term, ok := x.(*Term); ok {
		x = term.Value
	}

	switch x := x.(type) {

	// Scalars.
	case Null:
		return types.NewNull()
	case Boolean:
		return types.NewBoolean()
	case Number:
		return types.NewNumber()
	case String:
		return types.NewString()

	// Composites.
	case Array:
		static := make([]types.Type, len(x))
		for i := range static {
			tpe := env.Get(x[i].Value)
			static[i] = tpe
		}

		var dynamic types.Type
		if len(static) == 0 {
			dynamic = types.A
		}

		return types.NewArray(static, dynamic)

	case Object:
		static := []*types.StaticProperty{}
		var dynamic *types.DynamicProperty

		x.Foreach(func(k, v *Term) {
			if IsConstant(k.Value) {
				kjson, err := JSON(k.Value)
				if err != nil {
					panic("unreachable")
				}
				tpe := env.Get(v)
				static = append(static, types.NewStaticProperty(kjson, tpe))
			} else {
				typeK := env.Get(k.Value)
				typeV := env.Get(v.Value)
				dynamic = types.NewDynamicProperty(typeK, typeV)
			}
		})

		if len(static) == 0 && dynamic == nil {
			dynamic = types.NewDynamicProperty(types.A, types.A)
		}

		return types.NewObject(static, dynamic)

	case Set:
		var tpe types.Type
		x.Foreach(func(elem *Term) {
			other := env.Get(elem.Value)
			tpe = types.Or(tpe, other)
		})
		if tpe == nil {
			tpe = types.A
		}
		return types.NewSet(tpe)

	// Comprehensions.
	case *ArrayComprehension:
		checker := newTypeChecker()
		cpy, errs := checker.CheckBody(env, x.Body)
		if len(errs) == 0 {
			return types.NewArray(nil, cpy.Get(x.Term))
		}
		return nil
	case *ObjectComprehension:
		checker := newTypeChecker()
		cpy, errs := checker.CheckBody(env, x.Body)
		if len(errs) == 0 {
			return types.NewObject(nil, types.NewDynamicProperty(cpy.Get(x.Key), cpy.Get(x.Value)))
		}
		return nil
	case *SetComprehension:
		checker := newTypeChecker()
		cpy, errs := checker.CheckBody(env, x.Body)
		if len(errs) == 0 {
			return types.NewSet(cpy.Get(x.Term))
		}
		return nil

	// Refs.
	case Ref:
		return env.getRef(x)

	// Vars.
	case Var:
		if node := env.tree.Child(x); node != nil {
			return node.Value()
		}
		if env.next != nil {
			return env.next.Get(x)
		}
		return nil

	default:
		panic("unreachable")
	}
}
1296641
func (t *Collection) Get(key []byte) (val []byte, err error) {
	i, err := t.GetItem(key, true)
	if err != nil {
		return nil, err
	}
	if i != nil {
		return i.Val, nil
	}
	return nil, nil
}
206604
func (e *Error) Get() error {
	e.lock.RLock()
	defer e.lock.RUnlock()

	return e.err
}
288534
func (m *collection) Get(key []byte, readOptions ReadOptions) ([]byte, error) {
	if m.isClosed() {
		return nil, ErrClosed
	}

	atomic.AddUint64(&m.stats.TotGet, 1)

	val, err := m.get(key, readOptions)

	if err != nil {
		atomic.AddUint64(&m.stats.TotGetErr, 1)
	}

	return val, err
}
121577
func (e Environment) Get(name string) (value string, ok bool) {
	for _, env := range e {
		if env.Name == name {
			return env.Value, true
		}
	}
	return "", false
}
305224
func (s *store) Get(ctx context.Context, key string, resourceVersion string, out runtime.Object, ignoreNotFound bool) error {
	key = path.Join(s.pathPrefix, key)
	startTime := time.Now()
	getResp, err := s.client.KV.Get(ctx, key, s.getOps...)
	metrics.RecordEtcdRequestLatency("get", getTypeName(out), startTime)
	if err != nil {
		return err
	}

	if len(getResp.Kvs) == 0 {
		if ignoreNotFound {
			return runtime.SetZeroValue(out)
		}
		return storage.NewKeyNotFoundError(key, 0)
	}
	kv := getResp.Kvs[0]

	data, _, err := s.transformer.TransformFromStorage(kv.Value, authenticatedDataString(key))
	if err != nil {
		return storage.NewInternalError(err.Error())
	}

	return decode(s.codec, s.versioner, data, out, kv.ModRevision)
}
909666
func (c *Func) Get(key string, params imageserver.Params) (*imageserver.Image, error) {
	return c.GetFunc(key, params)
}
663922
func (h *DBHandle) Get(key []byte) ([]byte, error) {
	return h.db.Get(constructLevelKey(h.dbName, key))
}
1128219
func (rc *Redis) Get(key string) (interface{}, error) {
	val, err := rc.do("GET", key)
	if err != nil {
		if rc.Debug {
			log.Println("[Redis]GetErr: ", err, "Key:", key)
		}
		return nil, err
	}
	var v interface{}
	err = Decode(val.([]byte), &v)
	if err != nil {
		if rc.Debug {
			log.Println("[Redis]DecodeErr: ", err, "Key:", key)
		}
		return nil, err
	}
	if rc.Debug {
		log.Println("[Redis]Get: ", key)
	}
	return v, err
}
563119
func (k *ArrayKeyring) Get(key string) (Item, error) {
	if i, ok := k.items[key]; ok {
		return i, nil
	}
	return Item{}, ErrKeyNotFound
}
996639
func (c *Collection) Get(i gtreap.Item) gtreap.Item {
	root := c.currentRoot()
	if root == nil {
		return nil
	}
	return root.Get(i)
}