// GetFork returns the Fork field if it's non-nil, zero value otherwise.
961854
func (r *Repository) GetFork() bool {
	if r == nil || r.Fork == nil {
		return false
	}
	return *r.Fork
}
190527
func (v *RPC) GetProcedure() (o string) {
	if v != nil {
		o = v.Procedure
	}
	return
}
163710
func (c *DbClient) GetDataForKey(key string) (*decoder.FileDataEntry, bool) {
	c.Lock()
	defer c.Unlock()

	for _, file := range c.db {
		value, ok := file[key]
		if ok {
			return &decoder.FileDataEntry{
				Key:   key,
				Value: value.data,
			}, true
		}
	}
	return nil, false
}
1361481
func GetFromThread(pid, tid int) (NsHandle, error) {
	return GetFromPath(fmt.Sprintf("/proc/%d/task/%d/ns/net", pid, tid))
}
1264986
func (s *service) getProcess(id, execID string) (*process, error) {
	s.mu.Lock()
	defer s.mu.Unlock()

	return s.getProcessLocked(id, execID)
}
949023
func (k *Kloneable) kloneNeedsFork() (string, error) {
	local.Printf("Forking [%s/%s] to [%s/%s]", k.repo.Owner(), k.repo.Name(), k.gitServer.OwnerName(), k.repo.Name())
	var newRepo provider.Repo
	newRepo, err := k.gitServer.Fork(k.repo, k.gitServer.OwnerName())
	if err != nil {
		if strings.Contains(err.Error(), "job scheduled on GitHub side") || strings.Contains(err.Error(), "404 Not Found") {
			// Forking might take a while, so poll for it
			for i := 1; i <= waitForForkSeconds; i++ {
				repo, err := k.gitServer.GetRepo(k.repo.Name())
				newRepo = repo
				if err == nil {
					local.Printf("Succesfully detected new repository [%s/%s]", repo.Owner(), repo.Name())
					break
				}
				if i == waitForForkSeconds {
					return "", fmt.Errorf("unable to detect forked repository after waiting %d seconds", waitForForkSeconds)
				}
				time.Sleep(time.Second * 1)
			}
		} else {
			return "", err
		}
	}
	local.Printf("Attempting git clone")
	// clone with the original repo
	path, err := k.kloner.Clone(k.repo)
	if err != nil {
		return "", err
	}
	// Always delete origin
	local.Printf("Register remote [origin]")
	err = k.kloner.DeleteRemote("origin")
	if err != nil && !strings.Contains(err.Error(), "remote not found") {
		return path, err
	}
	// Add origin
	err = k.kloner.AddRemote("origin", newRepo.GitRemoteUrl())
	if err != nil {
		return path, err
	}

	// Add Upstream
	local.Printf("Register remote [upstream]")
	err = k.kloner.DeleteRemote("upstream")
	if err != nil && !strings.Contains(err.Error(), "remote not found") {
		return path, err
	}
	err = k.kloner.AddRemote("upstream", k.repo.GitRemoteUrl())
	if err != nil {
		return path, err
	}

	// Pull
	err = k.kloner.Pull("upstream")
	if err != nil {
		return path, err
	}

	return path, nil
}
105730
func (p *PushEvent) GetAfter() string {
	if p == nil || p.After == nil {
		return ""
	}
	return *p.After
}
1334142
func GetStack(err error) string {
	if err == nil {
		return ""
	}
	cast, ok := err.(*Error)
	if !ok {
		return ""
	}
	return cast.Stack()
}
1138842
func isForked(s, head *big.Int) bool {
	if s == nil || head == nil {
		return false
	}
	return s.Cmp(head) <= 0
}
890376
func (c *Config) GetStringOk(key string) (s string, ok bool) {
	v, ok := c.GetOk(key)
	if !ok {
		return "", false
	}
	s, ok = v.(string)
	return
}
1257701
func (w *WebHookPayload) GetAfter() string {
	if w == nil || w.After == nil {
		return ""
	}
	return *w.After
}
74896
func (md *MDServerMemory) GetForHandle(ctx context.Context, handle tlf.Handle,
	mStatus kbfsmd.MergeStatus, _ *keybase1.LockID) (
	tlf.ID, *RootMetadataSigned, error) {
	if err := checkContext(ctx); err != nil {
		return tlf.NullID, nil, err
	}

	id, created, err := md.getHandleID(ctx, handle, mStatus)
	if err != nil {
		return tlf.NullID, nil, err
	}

	if created {
		return id, nil, nil
	}

	rmds, err := md.GetForTLF(ctx, id, kbfsmd.NullBranchID, mStatus, nil)
	if err != nil {
		return tlf.NullID, nil, err
	}
	return id, rmds, nil
}
639145
func (obj *GenericObject) GetInfoRaw(ctx context.Context) (json.RawMessage, error) {
	result := &struct {
		Info json.RawMessage	`json:"qInfo"`
	} {}
	err := obj.rpc(ctx, "GetInfo", result)
	return result.Info, err 
}
914143
func isQuickFork(commits []*githubCommit, createdAt time.Time) bool {
	oneWeekOld := createdAt.Add(7 * 24 * time.Hour)
	if oneWeekOld.After(time.Now()) {
		return false // a newborn baby of a repository
	}
	n := 0
	for _, commit := range commits {
		if commit.Commit.Committer.Date.After(oneWeekOld) {
			return false
		}
		if commit.Commit.Committer.Date.Before(createdAt) {
			break
		}
		n++
	}
	return n < 3
}
585385
func (ids *mempoolIDs) GetForPeer(peer p2p.Peer) uint16 {
	ids.mtx.RLock()
	defer ids.mtx.RUnlock()

	return ids.peerMap[peer.ID()]
}
710507
func (c *Client) GetBlockHeaderAsync(blockHash *chainhash.Hash) FutureGetBlockHeaderResult {
	hash := ""
	if blockHash != nil {
		hash = blockHash.String()
	}

	cmd := btcjson.NewGetBlockHeaderCmd(hash, btcjson.Bool(false))
	return c.sendCmd(cmd)
}
979511
func (prof *Profiler) Get() (procs *Processors, err error) {
	procs = New()
	err = prof.getCPUInfo(procs)
	if err != nil {
		return nil, err
	}
	// process the system cpu info
	err = prof.getSysFSCPU(procs)
	if err != nil {
		return nil, err
	}
	procs.CPUs = procs.Sockets * int32(procs.CoresPerSocket) * int32(procs.ThreadsPerCore)

	uname := syscall.Utsname{}
	err = syscall.Uname(&uname)
	if err != nil {
		return nil, err
	}
	// convert [65]int8 to []uint8 so othat we can use it as a string
	var arch []uint8
	for _, v := range uname.Machine {
		if v == 0x00 {
			break
		}
		arch = append(arch, uint8(v))
	}
	procs.Architecture = string(arch)

	// get numa information
	err = prof.getNodeInfo(procs)
	if err != nil {
		return nil, err
	}
	return procs, nil
}