// getKey returns the key which is held in s by two brackets.
// It also returns the next selector.
9464
func getKey(s string) (string, string) {
	selSegs := strings.SplitN(s, PathSeparator, 2)
	thisSel := selSegs[0]
	nextSel := ""

	if len(selSegs) > 1 {
		nextSel = selSegs[1]
	}

	mapMatches := mapAccessRegex.FindStringSubmatch(s)
	if len(mapMatches) > 0 {
		if _, err := strconv.Atoi(mapMatches[2]); err != nil {
			thisSel = mapMatches[1]
			nextSel = "[" + mapMatches[2] + "]" + mapMatches[3]

			if thisSel == "" {
				thisSel = mapMatches[2]
				nextSel = mapMatches[3]
			}

			if nextSel == "" {
				selSegs = []string{"", ""}
			} else if nextSel[0] == '.' {
				nextSel = nextSel[1:]
			}
		}
	}

	return thisSel, nextSel
}
1358440
func (s *ClusterService) GetKeyName() string {
	// WARNING - STABLE API: Changing the structure of the key may break
	// backwards compatibility
	return path.Join(s.Cluster, s.Namespace, s.Name)
}
822146
func (s *RepositoriesService) GetKey(ctx context.Context, owner string, repo string, id int64) (*Key, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/keys/%v", owner, repo, id)

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	key := new(Key)
	resp, err := s.client.Do(ctx, req, key)
	if err != nil {
		return nil, resp, err
	}

	return key, resp, nil
}
1172206
func GetKey(name string, tags map[string]string, tagsSep string, tagKVSep string) string {
	keys := make([]string, 0, len(tags))
	for k := range tags {
		keys = append(keys, k)
	}
	sort.Strings(keys)
	key := name
	for _, k := range keys {
		key = key + tagsSep + k + tagKVSep + tags[k]
	}
	return key
}
1305083
func (ks *dummyKeyStore) GetKey(ski []byte) (bccsp.Key, error) {
	return nil, errors.New("Key not found. This is a dummy KeyStore")
}
1131734
func (c *controller) getKeys(subsys string) ([][]byte, []uint64) {
	c.Lock()
	defer c.Unlock()

	sort.Sort(ByTime(c.keys))

	keys := [][]byte{}
	tags := []uint64{}
	for _, key := range c.keys {
		if key.Subsystem == subsys {
			keys = append(keys, key.Key)
			tags = append(tags, key.LamportTime)
		}
	}

	keys[0], keys[1] = keys[1], keys[0]
	tags[0], tags[1] = tags[1], tags[0]
	return keys, tags
}
107370
func (v *RPC) GetShardKey() (o string) {
	if v != nil && v.ShardKey != nil {
		return *v.ShardKey
	}

	return
}
1249336
func (kr *GroupResolver) GetKeys(name string) ([]Key, error) {
	kr.RLock()
	defer kr.RUnlock()
	if keys, ok := kr.keyMap[name]; ok {
		return keys, nil
	}
	return nil, ErrKeyDoesNotExist
}
311090
func (v Values) GetStr(key interface{}) interface{} {
	if v == nil { return "" }
	
	val := v.Get(key)
	if val == nil { return "" }

	str, ok := val.(string)
	if !ok { return "" }
	return str
}
1498
func (s *Section) GetKey(name string) (*Key, error) {
	if s.f.BlockMode {
		s.f.lock.RLock()
	}
	if s.f.options.Insensitive {
		name = strings.ToLower(name)
	}
	key := s.keys[name]
	if s.f.BlockMode {
		s.f.lock.RUnlock()
	}

	if key == nil {
		// Check if it is a child-section.
		sname := s.name
		for {
			if i := strings.LastIndex(sname, "."); i > -1 {
				sname = sname[:i]
				sec, err := s.f.GetSection(sname)
				if err != nil {
					continue
				}
				return sec.GetKey(name)
			}
			break
		}
		return nil, fmt.Errorf("error when getting key of section '%s': key '%s' not exists", s.name, name)
	}
	return key, nil
}
1175700
func (g *PrefixKeyGenerator) GetKey(params imageserver.Params) string {
	return g.Prefix + g.KeyGenerator.GetKey(params)
}
1200703
func getKeys(info map[string]interface{}, keysSet map[string]bool) {
	for k, v := range info {
		if strings.Contains(k, "*") {
			kew := strings.Replace(k, "*", "", 1)
			keysSet[kew] = true
		}

		listofouts, ok := v.([]interface{})
		if ok {
			for i := range listofouts {
				aux, ok := listofouts[i].(map[string]interface{})
				if !ok {
					continue
				}
				getKeys(aux, keysSet)
			}
		}

		if aux, ok := v.(map[string]interface{}); ok {
			getKeys(aux, keysSet)
		}
	}
}
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)
}
206497
func (l *License) GetKey() string {
	if l == nil || l.Key == nil {
		return ""
	}
	return *l.Key
}
499879
func (rdb *RethinkDBKeyStore) GetKey(keyID string) data.PublicKey {
	dbPrivateKey, _, err := rdb.getKey(keyID)
	if err != nil {
		return nil
	}

	return data.NewPublicKey(dbPrivateKey.Algorithm, dbPrivateKey.Public)
}
961571
func (e *ApiClientService) GetKey(clientName string, keyName string) (data *ApiClientKey, err error) {
	url := fmt.Sprintf("clients/%s/keys/%s", clientName, keyName)
	err = e.client.magicRequestDecoder("GET", url, nil, &data)
	return
}
1274506
func (c *consulClient) Get(key string) ([]byte, error) {
	duration := spanstat.Start()
	pair, _, err := c.KV().Get(key, nil)
	increaseMetric(key, metricRead, "Get", duration.EndError(err).Total(), err)
	if err != nil {
		return nil, err
	}
	if pair == nil {
		return nil, nil
	}
	return pair.Value, nil
}