// hasKey - if the map 'key' exists append it to array
//          if it doesn't do nothing except scan array and map values
437810
func hasKey(iv interface{}, key string, ret *[]interface{}) {
	switch iv.(type) {
	case map[string]interface{}:
		vv := iv.(map[string]interface{})
		if v, ok := vv[key]; ok {
			*ret = append(*ret, v)
		}
		for _, v := range iv.(map[string]interface{}) {
			hasKey(v, key, ret)
		}
	case []interface{}:
		for _, v := range iv.([]interface{}) {
			hasKey(v, key, ret)
		}
	}
}
207769
func HasReason(ctx context.Context) bool {
	_, ok := ctx.Value(ctxKeyReason).(string)
	return ok
}
454920
func (s *Session) HasKey(key string) bool {
	s.RLock()
	defer s.RUnlock()

	_, has := s.data[key]
	return has
}
804716
func (u *User) Has(key string) bool {
	u.RLock()
	defer u.RUnlock()

	_, ok := u.data[key]
	return ok
}
573220
func (fs *FileSet) HasTagKey(name, key []byte) bool {
	for _, f := range fs.files {
		if e := f.TagKey(name, key); e != nil {
			return !e.Deleted()
		}
	}
	return false
}
1285340
func (t *ImmutableTree) Has(key []byte) bool {
	if t.root == nil {
		return false
	}
	return t.root.has(t, key)
}
138558
func Has(keyvals []KeyVal, keyword string) []KeyVal {
	return HasKeyword(keyvals, Keyword(keyword))
}
231366
func (m *SyncMap) Has(key string) bool {
	_, ok := m.Get(key)
	return ok
}
960513
func (m Metadata) Has(key string) (exists bool) {
	_, exists = m[key]
	return
}
706339
func (d Data) Has(key string) (interface{}, bool) {
	val, ok := d[key]
	return val, ok
}
981483
func (s *LDBStore) Has(_ context.Context, addr Address) bool {
	s.lock.RLock()
	defer s.lock.RUnlock()

	ikey := getIndexKey(addr)
	_, err := s.db.Get(ikey)

	return err == nil
}
660636
func (h *HashMap) Has(owner, key string) (bool, error) {
	rows, err := h.host.db.Query("SELECT "+valCol+" FROM "+h.table+" WHERE "+ownerCol+" = ? AND "+keyCol+" = ?", owner, key)
	if err != nil {
		return false, err
	}
	defer rows.Close()
	var value string
	// Get the value. Should only loop once.
	counter := 0
	for rows.Next() {
		err = rows.Scan(&value)
		if err != nil {
			// Unusual, worthy of panic
			panic(err.Error())
		}
		counter++
	}
	if err := rows.Err(); err != nil {
		// Unusual, worthy of panic
		panic(err.Error())
	}
	if counter > 1 {
		panic("Duplicate keys in hash map! " + value)
	}
	return counter > 0, nil
}
211696
func (t *Mutable) Has(key []byte) bool {
	if node, _ := t.get(key); node != nil {
		return true
	}
	return false
}
56926
func (d *Datastore) Has(key ds.Key) (exists bool, err error) {
	return ds.GetBackedHas(d, key)
}
971693
func (d *Diskv) Has(key string) bool {
	pathKey := d.transform(key)
	d.mu.Lock()
	defer d.mu.Unlock()

	if _, ok := d.cache[key]; ok {
		return true
	}

	filename := d.completeFilename(pathKey)
	s, err := os.Stat(filename)
	if err != nil {
		return false
	}
	if s.IsDir() {
		return false
	}

	return true
}
1339116
func (m *PHashMap) ContainsKey(key interface{}) bool {
	if key == nil {
		return m.hasNil
	}

	if m.root == nil {
		return false
	}

	return m.root.findD(0, Hash(key), key, phmNotFoundValue) != phmNotFoundValue
}
82794
func (o *Option) IsKey(key string) bool {
	return strings.ToLower(o.Key) == strings.ToLower(key)
}