// Get the element referenced by key in the HashMap
165086
func (hm *HashMap) Get(h Hashable) (interface{}, bool) {
	if _, ok := (*hm).keys[h.Hash()]; ok {
		v, ok := (*hm).values[h.Hash()]
		return v, ok
	}
	return nil, false
}
557582
func (m Map) Get(key string) string {
	if m == nil {
		return ""
	}
	vs := m[key]
	if len(vs) == 0 {
		return ""
	}
	return vs[0]
}
829798
func (m *Map) Get(k KeyType) (ValueType, bool) {
	hash := m.hash(k)
	for entry, ok := m.lookup[hash]; ok; entry, ok = m.lookup[hash] {
		if m.equals(entry.key.key, k) {
			return entry.value, true
		}
		// Linear probe to "next" to this entry (really a rehash)
		hash++
	}
	var empty ValueType
	return empty, false
}
393789
func (b UpdateMap) Get(ns, coll, key string) *statedb.VersionedValue {
	nsPvtBatch, ok := b[ns]
	if !ok {
		return nil
	}
	return nsPvtBatch.Get(coll, key)
}
607872
func getValue(m map[string]interface{}, keys []string) string {
	node := m[keys[0]]

	for i := 1; i < len(keys); i++ {
		key := keys[i]

		sliceNode, ok := node.([]interface{})
		if ok {
			intKey, err := strconv.Atoi(key)
			if err != nil {
				panic(fmt.Sprintf(
					"Cannot access nested slice element with non-integer key: %s",
					key))
			}
			node = sliceNode[intKey]
			continue
		}

		mapNode, ok := node.(map[string]interface{})
		if ok {
			node = mapNode[key]
			continue
		}

		panic(fmt.Sprintf(
			"Cannot descend into non-map non-slice object with key: %s", key))
	}

	if node == nil {
		return ""
	}

	return fmt.Sprintf("%v", node)
}
795808
func getMapAndMergeKeyValueByIndex(index int, mergeKey string, listOfMaps []interface{}) (map[string]interface{}, interface{}, error) {
	m, ok := listOfMaps[index].(map[string]interface{})
	if !ok {
		return nil, nil, mergepatch.ErrBadArgType(m, listOfMaps[index])
	}

	val, ok := m[mergeKey]
	if !ok {
		return nil, nil, mergepatch.ErrNoMergeKey(m, mergeKey)
	}
	return m, val, nil
}
554049
func (c *attrCache) Get(id uint64) map[string]interface{} {
	c.mu.RLock()
	defer c.mu.RUnlock()
	attrs := c.attrs[id]
	if attrs == nil {
		return nil
	}

	// Make a copy for safety
	ret := make(map[string]interface{})
	for k, v := range attrs {
		ret[k] = v
	}
	return ret
}
225929
func (s *shard) Get(key uint32) (interface{}, bool) {
	s.RLock()
	el, found := s.items[key]
	s.RUnlock()
	return el, found
}
368526
func (f *File) GetMap() map[string]map[string]string {
	ret := make(map[string]map[string]string)

	for _, section := range f.sections {
		s := make(map[string]string)
		for _, key := range section.keys {
			s[f.KeyManipFunc(key)] = f.ValueManipFunc(section.GetRaw(key))
		}

		ret[section.Name()] = s
	}

	return ret
}
7031
func (m *HashMap) GetUintKey(key uintptr) (value interface{}, ok bool) {
	// inline getUintptrHash()
	bh := reflect.SliceHeader{
		Data: uintptr(unsafe.Pointer(&key)),
		Len:  intSizeBytes,
		Cap:  intSizeBytes,
	}
	buf := *(*[]byte)(unsafe.Pointer(&bh))
	h := uintptr(siphash.Hash(sipHashKey1, sipHashKey2, buf))

	data, element := m.indexElement(h)
	if data == nil {
		return nil, false
	}

	// inline HashMap.searchItem()
	for element != nil {
		if element.keyHash == h && element.key == key {
			return element.Value(), true
		}

		if element.keyHash > h {
			return nil, false
		}

		element = element.Next()
	}
	return nil, false
}
1084444
func (n *Node) getChild(key string) *Node {
	if strings.Contains(key, "::") {
		key = strings.Replace(key, "::", ":", -1)
	}
	if v, ok := n.children[key]; ok {
		return v
	}
	for _, c := range n.segChildren {
		if c.segment == key {
			return c
		}
	}
	for _, c := range n.optionChildren {
		if c.segment == key {
			return c
		}
	}
	for _, c := range n.varyChildren {
		if c.segment == key {
			return c
		}
	}
	return nil
}
198165
func (m *MultiMap) Get(key interface{}) (values []interface{}, found bool) {
	values, found = m.m[key]
	return
}
386537
func (s *KeyGen) GetByKey(key string) (hash string, val interface{}, err error) {
	var r interface{}
	search := fmt.Sprintf("*:%s", key)

	if r, err = s.store().Do("KEYS", search); r != nil && err == nil {

		if _, _, hash, err = parseKeysResponse(r); err == nil {
			val, err = s.getHashMap(hash)
		}
	}
	return
}
1127792
func (m *lockingMap) Get(key string) (interface{}, bool) {
	m.keyLocker.RLock(key)
	defer m.keyLocker.RUnlock(key)

	m.lock.RLock()
	defer m.lock.RUnlock()

	val, ok := m.data[key]
	if ok && (m.checkFunc == nil || m.checkFunc(key, val)) {
		return val, true
	} else {
		// No value or it failed to check
		return nil, false
	}
}
976418
func (h *HashMap) Has(elementid, key string) (found bool, err error) {
	if h.name == nil {
		return false, ErrDoesNotExist
	}
	return found, (*bbolt.DB)(h.db).View(func(tx *bbolt.Tx) error {
		bucket := tx.Bucket(h.name)
		if bucket == nil {
			return ErrBucketNotFound
		}
		byteval := bucket.Get([]byte(elementid + ":" + key))
		if byteval != nil {
			found = true
		}
		return nil // Return from View function
	})
}
972042
func (m *HashMap) GetOrInsert(key interface{}, value interface{}) (actual interface{}, loaded bool) {
	h := getKeyHash(key)
	var newelement *ListElement

	for {
		data, element := m.indexElement(h)
		if data == nil {
			m.allocate(DefaultSize)
			continue
		}

		for element != nil {
			if element.keyHash == h {
				switch key.(type) {
				case []byte:
					if bytes.Compare(element.key.([]byte), key.([]byte)) == 0 {
						return element.Value(), true
					}
				default:
					if element.key == key {
						actual = element.Value()
						return actual, true
					}
				}
			}

			if element.keyHash > h {
				break
			}

			element = element.Next()
		}

		if newelement == nil { // allocate only once
			newelement = &ListElement{
				key:     key,
				keyHash: h,
				value:   unsafe.Pointer(&value),
			}
		}

		if m.insertListElement(newelement, false) {
			return value, false
		}
	}
}
1181442
func (m *Map) Get(k ident.ID) (MapValue, bool) {
	hash := m.hash(k)
	for entry, ok := m.lookup[hash]; ok; entry, ok = m.lookup[hash] {
		if m.equals(entry.key.key, k) {
			return entry.value, true
		}
		// Linear probe to "next" to this entry (really a rehash)
		hash++
	}
	var empty MapValue
	return empty, false
}