// Gets the key associated with specified title.
354392
func (r *KeyResource) FindName(title string) (*Key, error) {
	keys, err := r.List()
	if err != nil {
		return nil, err
	}

	for _, key := range keys {
		if key.Title == title {
			return key, nil
		}
	}

	return nil, ErrNotFound
}
910807
func Title(gender int) string {
	var title = ""
	switch gender {
	case Male:
		title = randomFrom(jsonData.MaleTitles)
		break
	case Female:
		title = randomFrom(jsonData.FemaleTitles)
		break
	default:
		title = FirstName(privateRand.Intn(2))
		break
	}
	return title
}
96088
func getPaperKey(m libkb.MetaContext, lastErr error, expectedPrefix *string) (keys *libkb.DeviceWithKeys, prefix string, err error) {
	passphrase, err := libkb.GetPaperKeyPassphrase(m, m.UIs().SecretUI, "", lastErr, expectedPrefix)
	if err != nil {
		return nil, "", err
	}

	return getPaperKeyFromString(m, passphrase)
}
876099
func (km *KeyManager) Get(k Key) KeyState {
	km.mutex.RLock()
	ks := km.mapper[k]
	km.mutex.RUnlock()

	return ks
}
445476
func (ppm *ProtoProducerMessage) GetKey() string {
	key, _ := ppm.Key.Encode()
	return string(key)
}
95720
func (j *Js) Getkey(key string, i int) *Js {
	num := i - 1
	if i > len((j.data).([]interface{})) {
		j.data = errors.New("index out of range list").Error()
		return j
	}
	if m, ok := (j.data).([]interface{}); ok {
		v := m[num].(map[string]interface{})
		if h, ok := v[key]; ok {
			j.data = h
			return j
		}

	}
	j.data = nil
	return j
}
504444
func (s *YubiStore) GetKeyInfo(keyID string) (trustmanager.KeyInfo, error) {
	return trustmanager.KeyInfo{}, fmt.Errorf("Not yet implemented")
}
143657
func (trust *NotarySigner) GetKey(keyid string) data.PublicKey {
	pubKey, _, err := trust.getKeyInfo(keyid)
	if err != nil {
		return nil
	}
	return pubKey
}
1175700
func (g *PrefixKeyGenerator) GetKey(params imageserver.Params) string {
	return g.Prefix + g.KeyGenerator.GetKey(params)
}
26690
func (t *TrafficPath) GetTitle() string {
	if t == nil || t.Title == nil {
		return ""
	}
	return *t.Title
}
214766
func (t *Tab) GetTitle() (string, error) {
	var title string
	var ok bool

	resp, err := t.EvaluateScript("window.top.document.title")
	if err != nil {
		return "", err
	}

	if title, ok = resp.Value.(string); !ok {
		return "", &ScriptEvaluationErr{Message: "title was not a string", ExceptionText: "unable to retrieve document title, was not a string"}
	}
	return title, nil
}
1043821
func (section *HeaderSection) Get(key string) core.TagSlice {
	if keyTags, ok := section.Values[key]; ok {
		return keyTags
	}
	return core.TagSlice{}
}
517098
func (v *StorageVol) GetKey() (string, error) {
	var err C.virError
	key := C.virStorageVolGetKeyWrapper(v.ptr, &err)
	if key == nil {
		return "", makeError(&err)
	}
	return C.GoString(key), nil
}
1040530
func (rp *Ringpop) getStatKey(key string) string {
	rp.stats.Lock()
	rpKey, ok := rp.stats.keys[key]
	if !ok {
		rpKey = fmt.Sprintf("%s.%s", rp.stats.prefix, key)
		rp.stats.keys[key] = rpKey
	}
	rp.stats.Unlock()

	return rpKey
}
868716
func (m *Milestone) GetTitle() string {
	if m == nil || m.Title == nil {
		return ""
	}
	return *m.Title
}
1100508
func getKey(key interface{}) (Key, rune, error) {
	switch t := key.(type) {
	case Key:
		return t, 0, nil
	case rune:
		return 0, t, nil
	default:
		return 0, 0, errors.New("unknown type")
	}
}
1089847
func (s *Section) getKey(key string) (*KeyValuePair, int) {
	// loop over lines and find the key
	lastSectionName := ""
	var lastSectionPos position
	for lastIdx, l := range s.file.lines {
		switch l.item.(type) {
		case *Section:
			if lastSectionName == s.name && lastSectionPos == s.pos {
				// must be entering a new section; so not found, return
				return nil, s.getInsertLocation(lastIdx - 1)
			}

			sect, _ := l.item.(*Section)
			lastSectionName = sect.name
			lastSectionPos = sect.pos

		case *KeyValuePair:
			kvp, _ := l.item.(*KeyValuePair)
			//fmt.Printf(">>> compare: %s//%s :: %s//%s\n", lastSectionName, s.name, kvp.key, key)
			if (lastSectionName == s.name && lastSectionPos == s.pos) && s.file.KeyCompFunc(kvp.key, key) {
				return kvp, lastIdx
			}
		}
	}

	// if we get here, then must be last section of file
	return nil, s.getInsertLocation(len(s.file.lines) - 1)
}