// RawGetValue pushes onto the stack value table[p] where table is the
// value at index on the stack, and p is a light userdata.  The access is
// raw, as it doesn't invoke metamethods.
//
// http://www.lua.org/manual/5.2/manual.html#lua_rawgetp
761494
func (l *State) RawGetValue(index int, p interface{}) {
	t := l.indexToValue(index).(*table)
	l.apiPush(t.at(p))
}
50416
func (db *BytesConnectionEtcd) GetValue(key string) (data []byte, found bool, revision int64, err error) {
	return getValueInternal(db.Logger, db.etcdClient, db.opTimeout, key)
}
192643
func (list *List) GetValue() interface{} {
	var values []interface{}
	for _, val := range list.values {
		values = append(values, val.GetValue())
	}
	return values
}
534132
func (mem *memNamedMapping) GetValue(name string) (value interface{}, exists bool) {
	mem.access.RLock()
	defer mem.access.RUnlock()

	item, found := mem.nameToIdx[name]
	if found {
		return item.value, found
	}
	return
}
726019
func (ls *LState) RawGet(tb *LTable, key LValue) LValue {
	return tb.RawGet(key)
}
170141
func (op *DTGPIOModuleOpenPin) gpioGetValue() (int, error) {
	var b []byte
	b = make([]byte, 1)
	n, e := op.valueFile.ReadAt(b, 0)

	value := 0
	if n > 0 {
		if b[0] == '1' {
			value = HIGH
		} else {
			value = LOW
		}
	}
	return value, e
}
718873
func (mvcc *MVCCLevelDB) RawBatchGet(keys [][]byte) [][]byte {
	mvcc.mu.Lock()
	defer mvcc.mu.Unlock()

	values := make([][]byte, 0, len(keys))
	for _, key := range keys {
		value, err := mvcc.db.Get(key, nil)
		terror.Log(err)
		values = append(values, value)
	}
	return values
}
1223678
func (item *protoTxnItem) GetValue(out proto.Message) error {
	if item.data != nil {
		proto.Merge(out, item.data)
	}
	return nil
}
793964
func GetRealValue(val *reflect.Value) interface{} {
	if val == nil {
		return nil
	}
	switch val.Kind() {
	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
		return val.Int()
	case reflect.String:
		return val.String()
	case reflect.Bool:
		return val.Bool()
	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
		return val.Uint()
	case reflect.Float32, reflect.Float64:
		return val.Float()
	default:
		return nil
	}
}
1153770
func (r *ProtoKeyValWrapper) GetValue(value proto.Message) error {
	err := r.ProtoKeyVal.GetValue(value)
	if err != nil {
		return err
	}
	_, err = r.decrypter.Decrypt(value, r.decryptFunc)
	return err
}
1170066
func (c *CredentialV2) GetValue() *CredentialValue {
	if c.State == "unset" { // v2 unset state
		return nil
	}
	if c.Value == nil { // v2 value nilled
		return nil
	}
	if c.Value.IsUnset() { // value contains v1 undefined type
		return nil
	}
	return c.Value
}
79678
func (s *Set) GetValue(name interface{}) string {
	if opt := s.Lookup(name); opt != nil {
		return opt.String()
	}
	return ""
}
1114319
func getRawValue(b json.RawMessage) (json.RawMessage, error) {
	var m map[string]json.RawMessage
	if err := json.Unmarshal(b, &m); err != nil {
		return nil, err
	}
	for _, v := range m {
		return v, nil
	}
	return nil, fmt.Errorf("Unable to extract the raw value from:\n\n%s\n\n", string(b))
}
1039400
func getParamValue(param string, dicts map[string]interface{}) (string, bool) {
	// split between inflectors and real param
	// real param and each inflector is seperated by `|`
	cleanParam, inflectors := func() (string, string) {
		arr := strings.SplitN(param, "|", 2)
		if len(arr) != 2 {
			return param, ""
		}
		return strings.TrimSpace(arr[0]), strings.TrimSpace(arr[1])
	}()

	// get the value
	val, ok := func() (string, bool) {
		// get from type parameters
		val, ok := dicts[cleanParam]
		if !ok {
			return "", false
		}
		return fmt.Sprintf("%v", val), true
	}()
	if !ok {
		return "", false
	}

	// inflect the value if needed
	if inflectors != "" {
		for _, inflector := range strings.Split(inflectors, "|") {
			inflector = strings.TrimSpace(inflector)
			var ok bool
			val, ok = doInflect(val, inflector)
			if !ok {
				log.Fatalf("invalid inflector " + inflector)
			}
		}
	}
	return val, true
}
127944
func Raw(s string) Value {
	if len(s) >= 2 && s[0] == '"' && s[len(s)-1] == '"' {
		return String(s[1 : len(s)-1])
	}
	return StringToValue(s)
}
1367731
func (k *KeyValueYARPCServer) GetValue(ctx context.Context, request *examplepb.GetValueRequest) (*examplepb.GetValueResponse, error) {
	if request == nil {
		return nil, errRequestNil
	}
	if request.Key == "" {
		return nil, errRequestKeyNil
	}
	k.RLock()
	if value, ok := k.items[request.Key]; ok {
		k.RUnlock()
		var nextError error
		k.Lock()
		if k.nextError != nil {
			nextError = k.nextError
			k.nextError = nil
		}
		k.Unlock()
		return &examplepb.GetValueResponse{Value: value}, nextError
	}
	k.RUnlock()
	return nil, yarpcerrors.Newf(yarpcerrors.CodeNotFound, request.Key)
}
240686
func (m *ContextManager) GetValue(key interface{}) (
	value interface{}, ok bool) {
	gid, ok := GetGoroutineId()
	if !ok {
		return nil, false
	}

	m.mtx.Lock()
	state, found := m.values[gid]
	m.mtx.Unlock()

	if !found {
		return nil, false
	}
	value, ok = state[key]
	return value, ok
}