// GetOrInsert returns the existing value for the key if present.
// Otherwise, it stores and returns the given value.
// The loaded result is true if the value was loaded, false if stored.
972042
func (m *HashMap) GetOrInsert(key interface{}, value interface{}) (actual interface{}, loaded bool) {
	h := getKeyHash(key)
	var newelement *ListElement

	for {
		data, element := m.indexElement(h)
		if data == nil {
			m.allocate(DefaultSize)
			continue
		}

		for element != nil {
			if element.keyHash == h {
				switch key.(type) {
				case []byte:
					if bytes.Compare(element.key.([]byte), key.([]byte)) == 0 {
						return element.Value(), true
					}
				default:
					if element.key == key {
						actual = element.Value()
						return actual, true
					}
				}
			}

			if element.keyHash > h {
				break
			}

			element = element.Next()
		}

		if newelement == nil { // allocate only once
			newelement = &ListElement{
				key:     key,
				keyHash: h,
				value:   unsafe.Pointer(&value),
			}
		}

		if m.insertListElement(newelement, false) {
			return value, false
		}
	}
}
1122826
func (c *Context) GetVertexAttribOffset(index, pname int) int {
	return c.Call("getVertexAttribOffset", index, pname).Int()
}
405211
func (c *Client) GetValue(key string) (data []byte, found bool, revision int64, err error) {
	var entry *decoder.FileDataEntry
	entry, found = c.db.GetDataForKey(key)
	data = entry.Value
	return
}
1300177
func (e *Element) GetCharacterData() (string, error) {
	e.lock.RLock()
	defer e.lock.RUnlock()

	if !e.ready {
		return "", &ElementNotReadyErr{}
	}

	return e.characterData, nil
}
1067617
func GetOrPanic(g Getter) func() string {
	return func() string {
		v, err := g.Get()
		if err != nil {
			panic(err)
		}
		return v
	}
}
960152
func (ec *EthereumClient) GetStorageAt(ctx *Context, account *Address, key *Hash, number int64) (storage []byte, _ error) {
	if number < 0 {
		return ec.client.StorageAt(ctx.context, account.address, key.hash, nil)
	}
	return ec.client.StorageAt(ctx.context, account.address, key.hash, big.NewInt(number))
}
504277
func GetStringErr(key string, args ...interface{}) (string, error) {
	return std.GetStringErr(key, args...)
}
298624
func (xlsx *xlsxC) getValueFrom(f *File, d *xlsxSST) (string, error) {
	switch xlsx.T {
	case "s":
		xlsxSI := 0
		xlsxSI, _ = strconv.Atoi(xlsx.V)
		if len(d.SI[xlsxSI].R) > 0 {
			value := ""
			for _, v := range d.SI[xlsxSI].R {
				value += v.T
			}
			return value, nil
		}
		return f.formattedValue(xlsx.S, d.SI[xlsxSI].T), nil
	case "str":
		return f.formattedValue(xlsx.S, xlsx.V), nil
	case "inlineStr":
		return f.formattedValue(xlsx.S, xlsx.IS.T), nil
	default:
		return f.formattedValue(xlsx.S, xlsx.V), nil
	}
}
198504
func (s *service) GetResourceOwnerId(email string) (userId uint) {
	entity, err := s.repo.FindByEmail(email)
	if err != nil {
		return 0
	}
	return entity.ID
}
369582
func (c *config) GetStringErr(key string, args ...interface{}) (string, error) {
	val, err := c.Get(key, args...)
	if err != nil {
		return "", err
	}
	sval, err := cfg.ToString(val)
	c.log(TOSTRING, err, toVarArgs(args, val, sval)...)
	return sval, err
}
560807
func getSecretRefValue(client kubernetes.Interface, namespace string, store *ResourceStore, secretSelector *corev1.SecretKeySelector) (string, error) {
	secret, ok := store.SecretStore[secretSelector.Name]
	if !ok {
		var err error
		secret, err = client.CoreV1().Secrets(namespace).Get(secretSelector.Name, metav1.GetOptions{})
		if err != nil {
			return "", err
		}
		store.SecretStore[secretSelector.Name] = secret
	}
	if data, ok := secret.Data[secretSelector.Key]; ok {
		return string(data), nil
	}
	return "", fmt.Errorf("key %s not found in secret %s", secretSelector.Key, secretSelector.Name)

}
1077395
func (i *Issue) GetRepositoryURL() string {
	if i == nil || i.RepositoryURL == nil {
		return ""
	}
	return *i.RepositoryURL
}
1031195
func (p *PullRequestBranch) GetRef() string {
	if p == nil || p.Ref == nil {
		return ""
	}
	return *p.Ref
}
543128
func (that *JSONNode) Get() interface{} {
	if that.t != TypeValue {
		panic(ErrorRetrieveUserValue)
	}
	if that.vChanged {
		rv := reflect.ValueOf(that.v)
		return rv.Elem().Interface()
	}
	return that.v
}
759495
func (tx *Tx) GetRect(index string) (func(s string) (min, max []float64),
	error) {
	if tx.db == nil {
		return nil, ErrTxClosed
	}
	idx, ok := tx.db.idxs[index]
	if !ok || idx.rect == nil {
		return nil, ErrNotFound
	}
	return idx.rect, nil
}
363997
func toUpperFirst(s string, args ...string) string {
	if s == "" {
		return s
	}
	r, n := utf8.DecodeRuneInString(s)
	return string(unicode.ToUpper(r)) + s[n:]
}
1367731
func (k *KeyValueYARPCServer) GetValue(ctx context.Context, request *examplepb.GetValueRequest) (*examplepb.GetValueResponse, error) {
	if request == nil {
		return nil, errRequestNil
	}
	if request.Key == "" {
		return nil, errRequestKeyNil
	}
	k.RLock()
	if value, ok := k.items[request.Key]; ok {
		k.RUnlock()
		var nextError error
		k.Lock()
		if k.nextError != nil {
			nextError = k.nextError
			k.nextError = nil
		}
		k.Unlock()
		return &examplepb.GetValueResponse{Value: value}, nextError
	}
	k.RUnlock()
	return nil, yarpcerrors.Newf(yarpcerrors.CodeNotFound, request.Key)
}