// SortedKeys returns a list of sorted label keys of the postings.
423130
func (p *MemPostings) SortedKeys() []labels.Label {
	p.mtx.RLock()
	keys := make([]labels.Label, 0, len(p.m))

	for n, e := range p.m {
		for v := range e {
			keys = append(keys, labels.Label{Name: n, Value: v})
		}
	}
	p.mtx.RUnlock()

	sort.Slice(keys, func(i, j int) bool {
		if d := strings.Compare(keys[i].Name, keys[j].Name); d != 0 {
			return d < 0
		}
		return keys[i].Value < keys[j].Value
	})
	return keys
}
360846
func (c *Client) ListKeys(prefix string) (keyval.BytesKeyIterator, error) {
	entries := c.db.GetDataForPrefix(prefix)
	var keysWithoutPrefix []string
	for _, entry := range entries {
		keysWithoutPrefix = append(keysWithoutPrefix, entry.Key)
	}
	return &bytesKeyIterator{len: len(keysWithoutPrefix), keys: keysWithoutPrefix, prefix: prefix}, nil
}
712309
func (s *Store) SortedActiveAddresses() []WalletAddress {
	s.mtx.RLock()
	defer s.mtx.RUnlock()

	addrs := make([]WalletAddress, 0,
		s.highestUsed+int64(len(s.importedAddrs))+1)
	for i := int64(rootKeyChainIdx); i <= s.highestUsed; i++ {
		a := s.chainIdxMap[i]
		info, ok := s.addrMap[getAddressKey(a)]
		if ok {
			addrs = append(addrs, info)
		}
	}
	for _, addr := range s.importedAddrs {
		addrs = append(addrs, addr)
	}
	return addrs
}
1367834
func (s *StatsiteSink) flattenKeyLabels(parts []string, labels []Label) string {
	for _, label := range labels {
		parts = append(parts, label.Value)
	}
	return s.flattenKey(parts)
}
13789
func (db *ProtoWrapper) ListKeys(prefix string) (keyval.ProtoKeyIterator, error) {
	return listKeysProtoInternal(db.broker, prefix)
}
653936
func sortStringKeys(m interface{}) []string {
	v := reflect.ValueOf(m)
	t := v.Type()
	if t.Kind() != reflect.Map || t.Key().Kind() != reflect.String {
		panic(fmt.Sprintf(
			"sortStringKeys may be called with a map[string]* only"))
	}

	keys := v.MapKeys()
	sortedKeys := make([]string, 0, len(keys))

	for _, k := range keys {
		key := k.Interface().(string)
		sortedKeys = append(sortedKeys, key)
	}

	sort.Strings(sortedKeys)
	return sortedKeys
}
855346
func (e *Ed25519) ListKeys(role data.RoleName) []string {
	keyIDs := make([]string, 0, len(e.keys))
	for id, edCryptoKey := range e.keys {
		if edCryptoKey.role == role {
			keyIDs = append(keyIDs, id)
		}
	}
	return keyIDs
}
367504
func (b *lowBuilder) sortedDBMS(named dbname) (map[string]interface{}, error) {
	if b.high.MySQL != "" {
		return b.dbIndexStorage("mysql", b.high.MySQL, named)
	}
	if b.high.PostgreSQL != "" {
		return b.dbIndexStorage("postgres", b.high.PostgreSQL, named)
	}
	if b.high.Mongo != "" {
		return b.mongoIndexStorage(b.high.Mongo, named)
	}
	return nil, nil
}
1202332
func (p *SortKeys) AsSort(data []Record) sort.Interface {
	return p.AsSortable(data)
}
677118
func mapFieldKeys(m map[*descriptor.FieldDescriptorProto]string) []*descriptor.FieldDescriptorProto {
	keys := make([]*descriptor.FieldDescriptorProto, 0, len(m))
	for k := range m {
		keys = append(keys, k)
	}
	sort.Sort(byTypeName(keys))
	return keys
}
662674
func (e *Encoder) SortMapKeys(flag bool) *Encoder {
	e.sortMapKeys = flag
	return e
}
238445
func NewSortedMapFromList(l []KeyValuePair) *SortedMap {
	ret := NewSortedMapFromSortedList(l)
	ret.sort()
	return ret
}
88990
func (k *ArrayKeyring) Keys() ([]string, error) {
	var keys = []string{}
	for key := range k.items {
		keys = append(keys, key)
	}
	return keys, nil
}
635962
func (c *Client) ListKeys(uName string) (map[string]string, error) {
	url := fmt.Sprintf("/user/%s/keys", uName)
	resp, err := c.get(url)
	if err != nil {
		return nil, err
	}
	keys := map[string]string{}
	err = json.Unmarshal(resp, &keys)
	return keys, err
}
507684
func (g *Graph) orderedRelatives(key *Key, attr, orderBy string, cb func(n *Node) []*Node) ([]*Node, error) {
	if !g.finalized {
		return nil, ErrNotFinalized
	}
	if err := g.validateKey(attr, key); err != nil {
		return nil, err
	}
	if err := validateOrder(orderBy); err != nil {
		return nil, err
	}
	if n := g.nodes[key]; n != nil {
		return sortByEdgeOrder(cb(n), orderBy), nil
	}
	return nil, nil // no node at all -> no related nodes
}
462695
func sortedHeaderFields(stringMap map[string][]string) []string {
	keyCount := 0
	sortedKeys := make([]string, len(stringMap))
	for k := range stringMap {
		sortedKeys[keyCount] = k
		keyCount++
	}
	sort.Strings(sortedKeys)
	return sortedKeys
}
1183837
func (s *set) Sorted() Array {
	cpy := make(Array, len(s.keys))
	for i := range cpy {
		cpy[i] = s.keys[i]
	}
	sort.Sort(termSlice(cpy))
	return cpy
}