// loadKeys loads the dom key definitions from the chromium source tree.
162067
func loadKeys(keys map[rune]kb.Key) error {
	// load key converter data
	keycodeConverterMap, err := loadKeycodeConverterData()
	if err != nil {
		return err
	}

	// load dom code map
	domKeyMap, err := loadDomKeyData()
	if err != nil {
		return err
	}

	// load US layout data
	layoutBuf, err := grab(domUsLayoutDataH)
	if err != nil {
		return err
	}

	// load scan code map
	scanCodeMap, err := loadScanCodes(keycodeConverterMap, domKeyMap, layoutBuf)
	if err != nil {
		return err
	}

	// process printable
	err = loadPrintable(keys, keycodeConverterMap, domKeyMap, layoutBuf, scanCodeMap)
	if err != nil {
		return err
	}

	// process non-printable
	err = loadNonPrintable(keys, keycodeConverterMap, domKeyMap, layoutBuf, scanCodeMap)
	if err != nil {
		return err
	}

	return nil
}
698088
func loadKeyringFile(c *serf.Config) error {
	if c.KeyringFile == "" {
		return nil
	}

	if _, err := os.Stat(c.KeyringFile); err != nil {
		return err
	}

	keyringData, err := ioutil.ReadFile(c.KeyringFile)
	if err != nil {
		return err
	}

	keys := make([]string, 0)
	if err := json.Unmarshal(keyringData, &keys); err != nil {
		return err
	}

	return loadKeyring(c, keys)
}
952690
func LoadKeysIncompat(r io.Reader) (k I2PKeys, err error) {
	var buff bytes.Buffer
	_, err = io.Copy(&buff, r)
	if err == nil {
		parts := strings.Split(buff.String(), "\n")
		k = I2PKeys{I2PAddr(parts[0]), parts[1]}
	}
	return
}
1307531
func (set *TagKeysSet) Keys() []string {
	keys := set.KeysBytes()
	s := make([]string, 0, len(keys))
	for i := range keys {
		s = append(s, string(keys[i]))
	}
	return s
}
733264
func (row *Row) UseKeys(indexes []int) (err error) {
	if indexes == nil {
		return nil
	}
	var keys, values []interface{}
	kLen, vLen := len(row.K), len(row.V)
	used := make([]bool, kLen+vLen)
	for _, x := range indexes {
		if x <= kLen {
			keys = append(keys, row.K[x-1])
		} else {
			keys = append(keys, row.V[x-1-kLen])
		}
		used[x-1] = true
	}
	for i, k := range row.K {
		if !used[i] {
			values = append(values, k)
		}
	}
	for i, v := range row.V {
		if !used[i+kLen] {
			values = append(values, v)
		}
	}
	row.K, row.V = keys, values
	return err
}
1086062
func (r *registry) Keys(pluginType consts.PluginType) []string {
	var keys []string
	switch pluginType {
	case consts.PluginTypeDatabase:
		for key := range r.databasePlugins {
			keys = append(keys, key)
		}
	case consts.PluginTypeCredential:
		for key := range r.credentialBackends {
			keys = append(keys, key)
		}
	case consts.PluginTypeSecrets:
		for key := range r.logicalBackends {
			keys = append(keys, key)
		}
	}
	return keys
}
896624
func (c *Config) LoadNamespaces(ctx context.Context, qs graph.QuadStore, dest *voc.Namespaces) error {
	var list []namespace
	if err := c.LoadTo(ctx, qs, &list); err != nil {
		return err
	}
	register := dest.Register
	if dest == nil {
		register = voc.Register
	}
	for _, ns := range list {
		register(voc.Namespace{
			Prefix: string(ns.Prefix),
			Full:   string(ns.Full),
		})
	}
	return nil
}
756793
func LoadNamespaces(ctx context.Context, qs graph.QuadStore, dest *voc.Namespaces) error {
	return global.LoadNamespaces(ctx, qs, dest)
}
728984
func LoadSecrets(source map[string]interface{}, details composetypes.ConfigDetails) (map[string]composetypes.SecretConfig, error) {
	secrets := make(map[string]composetypes.SecretConfig)
	if err := Transform(source, &secrets); err != nil {
		return secrets, err
	}
	for name, secret := range secrets {
		obj, err := loadFileObjectConfig(name, "secret", composetypes.FileObjectConfig(secret), details)
		if err != nil {
			return nil, err
		}
		secretConfig := composetypes.SecretConfig(obj)
		secretConfig.Extras = loadExtras(name, source)
		secrets[name] = secretConfig
	}
	return secrets, nil
}
971991
func (tl TypeLoader) LoadIndexes(args *ArgType, tableMap map[string]*Type) (map[string]*Index, error) {
	var err error

	ixMap := map[string]*Index{}
	for _, t := range tableMap {
		// load table indexes
		err = tl.LoadTableIndexes(args, t, ixMap)
		if err != nil {
			return nil, err
		}
	}

	// generate templates
	for _, ix := range ixMap {
		err = args.ExecuteTemplate(IndexTemplate, ix.Type.Name, ix.Index.IndexName, ix)
		if err != nil {
			return nil, err
		}
	}

	return ixMap, nil
}
1123993
func (c *ServiceConfigs) Keys() []string {
	keys := []string{}
	c.mu.RLock()
	defer c.mu.RUnlock()
	for name := range c.m {
		keys = append(keys, name)
	}
	return keys
}
1219859
func (c *baseCache) load(key interface{}, cb func(interface{}, *time.Duration, error) (interface{}, error), isWait bool) (interface{}, bool, error) {
	v, called, err := c.loadGroup.Do(key, func() (v interface{}, e error) {
		defer func() {
			if r := recover(); r != nil {
				e = fmt.Errorf("Loader panics: %v", r)
			}
		}()
		return cb(c.loaderExpireFunc(key))
	}, isWait)
	if err != nil {
		return nil, called, err
	}
	return v, called, nil
}
561027
func (s *GlobalStore) Keys(startKey []byte, limit int) (keys mock.Keys, err error) {
	s.mu.RLock()
	defer s.mu.RUnlock()

	var i int
	if startKey != nil {
		i, _ = s.keyIndex(startKey)
	}
	total := len(s.keys)
	max := maxIndex(i, limit, total)
	keys.Keys = make([][]byte, 0, max-i)
	for ; i < max; i++ {
		keys.Keys = append(keys.Keys, append([]byte(nil), s.keys[i]...))
	}
	if total > max {
		keys.Next = s.keys[max]
	}
	return keys, nil
}
1019155
func (m *SecureMap) Keys() []interface{} {
	m.lock.RLock()
	keys := make([]interface{}, len(m.data))
	count := 0
	for k := range m.data {
		keys[count] = k
		count++
	}
	m.lock.RUnlock()

	return keys
}
649432
func (that *JSONNode) GetKeys() []interface{} {
	var ret []interface{}
	switch that.t {
	case TypeMap:
		nb := len(that.m)
		ret = make([]interface{}, nb)
		for key := range that.m {
			nb--
			ret[nb] = key
		}
	case TypeArray:
		nb := len(that.a)
		ret = make([]interface{}, nb)
		for nb > 0 {
			nb--
			ret[nb] = nb
		}
	default:
		panic(ErrorGetKeys)
	}
	return ret
}
130546
func loadSecretKey(id string) ([keySize]byte, error) {

	var key [keySize]byte

	keyFile := fmt.Sprintf(secretSuffixFormat, id)
	if keyFileExists(keyFile) {
		return readKey(keyFile, keysFolderPrefixFormat)
	}

	// generate the random salt
	key, err := generateSecretKey()
	if err != nil {
		return key, err
	}

	// write the salt to the file with its prefix
	if err := writeKey(keyFile, keysFolderPrefixFormat, key[:]); err != nil {
		return key, err
	}

	// return the salt and no error
	return key, nil
}
1295405
func (kern *Kernel) LoadKeysFromConfig(conf *keys.KeysConfig) (err error) {
	kern.keyStore = keys.NewKeyStore(conf.KeysDirectory, conf.AllowBadFilePermissions)
	if conf.RemoteAddress != "" {
		kern.keyClient, err = keys.NewRemoteKeyClient(conf.RemoteAddress, kern.Logger)
		if err != nil {
			return err
		}
	} else {
		kern.keyClient = keys.NewLocalKeyClient(kern.keyStore, kern.Logger)
	}
	return nil
}