// GetPrivateGists returns the PrivateGists field if it's non-nil, zero value otherwise.
779599
func (o *Organization) GetPrivateGists() int {
	if o == nil || o.PrivateGists == nil {
		return 0
	}
	return *o.PrivateGists
}
1021709
func (o *Organization) GetOwnedPrivateRepos() int {
	if o == nil || o.OwnedPrivateRepos == nil {
		return 0
	}
	return *o.OwnedPrivateRepos
}
446755
func (s *cachedKeyService) GetPrivateKey(keyID string) (data.PrivateKey, data.RoleName, error) {
	s.lock.RLock()
	cachedKeyEntry, ok := s.cachedKeys[keyID]
	s.lock.RUnlock()
	if ok {
		return cachedKeyEntry.key, cachedKeyEntry.role, nil
	}

	// retrieve the key from the underlying store and put it into the cache
	privKey, role, err := s.CryptoService.GetPrivateKey(keyID)
	if err == nil {
		s.lock.Lock()
		defer s.lock.Unlock()
		// Add the key to cache
		s.cachedKeys[privKey.ID()] = &cachedKey{key: privKey, role: role}
		return privKey, role, nil
	}
	return nil, "", err
}
1371038
func (u *User) GetOwnedPrivateRepos() int {
	if u == nil || u.OwnedPrivateRepos == nil {
		return 0
	}
	return *u.OwnedPrivateRepos
}
933086
func (trust *NotarySigner) GetPrivateKey(keyid string) (data.PrivateKey, data.RoleName, error) {
	pubKey, role, err := trust.getKeyInfo(keyid)
	if err != nil {
		return nil, "", err
	}
	return NewRemotePrivateKey(pubKey, trust.sClient), role, nil
}
922778
func (d *Domain) GetBlkioParameters(flags DomainModificationImpact) (*DomainBlkioParameters, error) {
	params := &DomainBlkioParameters{}
	info := getBlkioParametersFieldInfo(params)

	var cnparams C.int
	var err C.virError
	ret := C.virDomainGetBlkioParametersWrapper(d.ptr, nil, &cnparams, 0, &err)
	if ret == -1 {
		return nil, makeError(&err)
	}

	cparams := typedParamsNew(cnparams)
	defer C.virTypedParamsFree(cparams, cnparams)
	ret = C.virDomainGetBlkioParametersWrapper(d.ptr, cparams, &cnparams, C.uint(flags), &err)
	if ret == -1 {
		return nil, makeError(&err)
	}

	_, gerr := typedParamsUnpack(cparams, cnparams, info)
	if gerr != nil {
		return nil, gerr
	}

	return params, nil
}
1130087
func (x *XC) ListPrivateKeyIDs(ctx context.Context) ([]string, error) {
	return x.secring.KeyIDs(), nil
}
1325719
func GetPrivateKey(d Depot, name string) (key *pkix.Key, err error) {
	b, err := d.Get(PrivKeyTag(name))
	if err != nil {
		return nil, err
	}
	return pkix.NewKeyFromPrivateKeyPEM(b)
}
32509
func (g *GPG) FindPrivateKeys(ctx context.Context, keys ...string) ([]string, error) {
	kl, err := g.ListPrivateKeyIDs(ctx)
	if err != nil {
		return nil, err
	}
	for i, key := range keys {
		if strings.HasPrefix(key, "0x") {
			key = strings.TrimPrefix(key, "0x")
		}
		keys[i] = strings.ToUpper(key)
	}
	matches := make([]string, 0, len(keys))
	for _, key := range kl {
		for _, needle := range keys {
			if strings.HasSuffix(key, needle) {
				matches = append(matches, key)
			}
		}
	}
	return matches, nil
}
379973
func (pm *ProviderManager) GetProviders(ctx context.Context, k cid.Cid) []peer.ID {
	gp := &getProv{
		k:    k,
		resp: make(chan []peer.ID, 1), // buffered to prevent sender from blocking
	}
	select {
	case <-ctx.Done():
		return nil
	case pm.getprovs <- gp:
	}
	select {
	case <-ctx.Done():
		return nil
	case peers := <-gp.resp:
		return peers
	}
}
1133559
func (mc MongoClient) getRegistrations(q bson.M) ([]models.Registration, error) {
	s := mc.getSessionCopy()
	defer s.Close()

	var regs []models.Registration
	err := s.DB(mc.database.Name).C(db.ExportCollection).Find(q).All(&regs)
	if err != nil {
		return []models.Registration{}, errorMap(err)
	}

	return regs, nil
}
1036073
func (client *Client) GetPrivateDomain(domainGUID string) (Domain, Warnings, error) {
	request, err := client.newHTTPRequest(requestOptions{
		RequestName: internal.GetPrivateDomainRequest,
		URIParams:   map[string]string{"private_domain_guid": domainGUID},
	})
	if err != nil {
		return Domain{}, nil, err
	}

	var domain Domain
	response := cloudcontroller.Response{
		DecodeJSONResponseInto: &domain,
	}

	err = client.connection.Make(request, &response)
	if err != nil {
		return Domain{}, response.Warnings, err
	}

	domain.Type = constant.PrivateDomain
	return domain, response.Warnings, nil
}
714036
func (p *Plan) GetPrivateRepos() int {
	if p == nil || p.PrivateRepos == nil {
		return 0
	}
	return *p.PrivateRepos
}
239389
func (vm *VM) GetIPs() ([]net.IP, error) {
	vmclient, err := vm.getVMClient()
	if err != nil {
		return nil, err
	}

	resp, err := vmclient.GetDeployment(vm.ServiceName, vm.Name)
	if err != nil {
		return nil, err
	}

	ips := make([]net.IP, 2)
	if ip := resp.VirtualIPs[0].Address; ip != "" {
		ips[PublicIP] = net.ParseIP(ip)
	}
	if ip := resp.RoleInstanceList[0].IPAddress; ip != "" {
		ips[PrivateIP] = net.ParseIP(ip)
	}

	return ips, nil
}
1296075
func (m *Machine) PrivateAddress() (network.Address, error) {
	privateAddress := m.doc.PreferredPrivateAddress.networkAddress()
	var err error
	if privateAddress.Value == "" {
		err = network.NoAddressError("private")
	}
	return privateAddress, err
}
313753
func (c *ConfigurationData) GetServiceAccountPrivateKey() ([]byte, string) {
	return []byte(c.v.GetString(varServiceAccountPrivateKey)), c.v.GetString(varServiceAccountPrivateKeyID)
}
260735
func (c *Ctx) CheckPrivateKey() error {
	runtime.LockOSThread()
	defer runtime.UnlockOSThread()
	if int(C.SSL_CTX_check_private_key(c.ctx)) != 1 {
		return errorFromErrorQueue()
	}
	return nil
}