// partitionKeys sorts keys by their type.
548559
func partitionKeys(keys []Key) ([]*rsa.PublicKey, []*ecdsa.PublicKey, [][]byte) {
	var (
		rsaKeys   []*rsa.PublicKey
		ecdsaKeys []*ecdsa.PublicKey
		hmacKeys  [][]byte
	)

	for _, key := range keys {
		switch k := key.(type) {
		case *rsa.PublicKey:
			rsaKeys = append(rsaKeys, k)
		case *ecdsa.PublicKey:
			ecdsaKeys = append(ecdsaKeys, k)
		case []byte:
			hmacKeys = append(hmacKeys, k)
		case string:
			hmacKeys = append(hmacKeys, []byte(k))
		}
	}

	return rsaKeys, ecdsaKeys, hmacKeys
}
225342
func (m *PostgreSQLBackend) splitKey(fullPath string) (string, string, string) {
	var parentPath string
	var path string

	pieces := strings.Split(fullPath, "/")
	depth := len(pieces)
	key := pieces[depth-1]

	if depth == 1 {
		parentPath = ""
		path = "/"
	} else if depth == 2 {
		parentPath = "/"
		path = "/" + pieces[0] + "/"
	} else {
		parentPath = "/" + strings.Join(pieces[:depth-2], "/") + "/"
		path = "/" + strings.Join(pieces[:depth-1], "/") + "/"
	}

	return parentPath, path, key
}
308011
func (o *orderedDict) keys() isolated.HexDigests {
	out := make(isolated.HexDigests, 0, o.length())
	for e := o.ll.Front(); e != nil; e = e.Next() {
		out = append(out, e.Value.(*entry).key)
	}
	return out
}
628099
func (o *orderedMap) OrderedKeys() *list.List {
	if o.orderedKeys == nil {
		return list.New()
	}
	return o.orderedKeys
}
684193
func (pk PrimaryKey) ClusteringKeySet() map[string]struct{} {
	m := make(map[string]struct{})
	for _, c := range pk.ClusteringKeys {
		m[c.Name] = struct{}{}
	}
	return m
}
209613
func (s *PutRecordsRequestEntry) SetPartitionKey(v string) *PutRecordsRequestEntry {
	s.PartitionKey = &v
	return s
}
462569
func (l DocumentMetaSlice) Keys() []string {
	keys := make([]string, len(l))
	for i, m := range l {
		keys[i] = m.Key
	}
	return keys
}
1061559
func parsePartitionKey(pkStr string) []string {
	pkStr = strings.TrimSpace(pkStr)
	var pks []string
	partitionKeys := strings.Split(pkStr, ",")
	for _, pk := range partitionKeys {
		npk := strings.TrimSpace(pk)
		if len(pk) > 0 {
			pks = append(pks, npk)
		}
	}
	return pks
}
655737
func (f *SeriesFile) SeriesIDTypedBySeriesKey(key []byte) SeriesIDTyped {
	keyPartition := f.SeriesKeyPartition(key)
	if keyPartition == nil {
		return SeriesIDTyped{}
	}
	return keyPartition.FindIDTypedBySeriesKey(key)
}
229914
func parseClusteringKeys(ckStr string) ([]*ClusteringKey, error) {
	ckStr = strings.TrimSpace(ckStr)
	cks := strings.Split(ckStr, ",")
	var clusteringKeys []*ClusteringKey
	for _, ck := range cks {
		fields := strings.Fields(ck)
		if len(fields) == 0 {
			continue
		}
		if len(fields) > 2 {
			return nil, fmt.Errorf("Clustering key definition %q should look like \"name[ asc/desc]\"",
				ck)
		}
		descending := false
		if len(fields) == 2 {
			switch strings.ToLower(fields[1]) {
			case desc:
				descending = true
			case asc:
				descending = false
			default:
				return nil, fmt.Errorf("invalid clustering key order %q in %q", fields[1], ck)
			}

		}

		clusteringKeys = append(clusteringKeys, &ClusteringKey{Name: strings.TrimSpace(fields[0]), Descending: descending})
	}
	return clusteringKeys, nil
}
539339
func (s *KinesisAction) SetPartitionKey(v string) *KinesisAction {
	s.PartitionKey = &v
	return s
}
1230542
func ResourceKeyPartition(filename string) string {
	ext := strings.TrimPrefix(path.Ext(filepath.ToSlash(filename)), ".")
	if ext == "" {
		ext = CACHE_OTHER
	}
	return ext
}
1324009
func (s *PutRecordInput) SetPartitionKey(v string) *PutRecordInput {
	s.PartitionKey = &v
	return s
}
226604
func typeOfKey(k string) string {
	c := strings.Index(k, ":")
	p := strings.Index(k, "|")
	if c < 0 && p < 0 {
		return ""
	}
	if c < 0 {
		return k[:p]
	}
	if p < 0 {
		return k[:c]
	}
	min := c
	if p < min {
		min = p
	}
	return k[:min]
}
328578
func MapKeySeparator(sep rune) Option {
	return func(ini *INI) error {
		ini.mapkeySep = sep
		return nil
	}
}
645267
func (eq Eq) sortedKeys() []string {
	keys := make([]string, 0, len(eq))
	for key := range eq {
		keys = append(keys, key)
	}
	sort.Strings(keys)
	return keys
}
946225
func (n *rootNode) GetKeys() (keys []string) {
	if err := n.genMapBuf(); err != nil {
		return
	}
	keys = make([]string, 0, len(n.mapBuf))
	for key := range n.mapBuf {
		keys = append(keys, key)
	}
	return
}