// GetTermDimensions returns the width and height of the current terminal
173780
func (w *Writer) GetTermDimensions() (int, int) {
	cmd := exec.Command("stty", "size")
	cmd.Stdin = os.Stdin
	out, err := cmd.Output()
	if err != nil {
		return 80, 25
	}
	splits := strings.Split(strings.Trim(string(out), "\n"), " ")
	height, err := strconv.ParseInt(splits[0], 0, 0)
	width, err1 := strconv.ParseInt(splits[1], 0, 0)
	if err != nil || err1 != nil {
		return 80, 25
	}
	return int(width), int(height)
}
35191
func (y *Yaml) GetArraySize() (int, error) {
	a, err := y.Array()
	if err != nil {
		return 0, err
	}
	return len(a), nil
}
859052
func (db *DB) getMems() (e, f *memDB) {
	db.memMu.RLock()
	defer db.memMu.RUnlock()
	if db.mem != nil {
		db.mem.incref()
	} else if !db.isClosed() {
		panic("nil effective mem")
	}
	if db.frozenMem != nil {
		db.frozenMem.incref()
	}
	return db.mem, db.frozenMem
}
1311710
func (b *Blob) GetSize() int {
	if b == nil || b.Size == nil {
		return 0
	}
	return *b.Size
}
394451
func (obj *GenericDimension) GetDimensionRaw(ctx context.Context) (json.RawMessage, error) {
	result := &struct {
		Dim json.RawMessage	`json:"qDim"`
	} {}
	err := obj.rpc(ctx, "GetDimension", result)
	return result.Dim, err 
}
1364866
func getTtySize(terminalFd uintptr) (int, int) {
	ws, err := term.GetWinsize(terminalFd)
	if err != nil {
		if ws == nil {
			return 0, 0
		}
	}
	return int(ws.Height), int(ws.Width)
}
939710
func (renderer *Renderer) GetLogicalSize() (w, h int32) {
	C.SDL_RenderGetLogicalSize(
		renderer.cptr(),
		(*C.int)(unsafe.Pointer(&w)),
		(*C.int)(unsafe.Pointer(&h)))
	return
}
48489
func (dds *Delayed) GetSize(key ds.Key) (size int, err error) {
	dds.delay.Wait()
	return dds.ds.GetSize(key)
}
293174
func (d *NullDatastore) GetSize(key Key) (size int, err error) {
	return -1, ErrNotFound
}
99374
func getCertExtensions(cert *x509.Certificate) Extensions {
	// initialize []string to store them as `[]` instead of null
	san := make([]string, 0)
	san = append(san, cert.DNSNames...)
	crld := make([]string, 0)
	crld = append(crld, cert.CRLDistributionPoints...)
	constraints, _ := certconstraints.Get(cert)
	ipNetSliceToStringSlice := func(in []*net.IPNet) []string {
		out := make([]string, 0)
		for _, ipnet := range in {
			out = append(out, ipnet.String())
		}
		return out
	}
	permittedIPAddresses := ipNetSliceToStringSlice(constraints.PermittedIPRanges)
	excludedIPAddresses := ipNetSliceToStringSlice(constraints.ExcludedIPRanges)
	ext := Extensions{
		AuthorityKeyId:           base64.StdEncoding.EncodeToString(cert.AuthorityKeyId),
		SubjectKeyId:             base64.StdEncoding.EncodeToString(cert.SubjectKeyId),
		KeyUsage:                 getKeyUsages(cert),
		ExtendedKeyUsage:         getExtKeyUsages(cert),
		ExtendedKeyUsageOID:      getExtKeyUsageOIDs(cert),
		PolicyIdentifiers:        getPolicyIdentifiers(cert),
		SubjectAlternativeName:   san,
		CRLDistributionPoints:    crld,
		PermittedDNSDomains:      constraints.PermittedDNSDomains,
		ExcludedDNSDomains:       constraints.ExcludedDNSDomains,
		PermittedIPAddresses:     permittedIPAddresses,
		ExcludedIPAddresses:      excludedIPAddresses,
		IsTechnicallyConstrained: certconstraints.IsTechnicallyConstrained(cert),
	}
	return ext
}
244675
func (t *terminal) GetWinSize() (*term.Winsize, error) {
	t.mu.Lock()
	defer t.mu.Unlock()
	if t.pty == nil {
		return nil, trace.NotFound("no pty")
	}
	ws, err := term.GetWinsize(t.pty.Fd())
	if err != nil {
		return nil, trace.Wrap(err)
	}
	return ws, nil
}
685797
func (bs *BuildSummary) GetConsoleNames() ([]string, error) {
	ret := stringset.New(0)
	for _, mk := range bs.ManifestKeys {
		r := bytes.NewReader(mk)
		vers, _, err := cmpbin.ReadUint(r)
		if err != nil || vers != currentManifestKeyVersion {
			continue
		}
		proj, _, err := cmpbin.ReadString(r)
		if err != nil {
			return nil, errors.Annotate(err, "couldn't parse proj").Err()
		}
		console, _, err := cmpbin.ReadString(r)
		if err != nil {
			return nil, errors.Annotate(err, "couldn't parse console").Err()
		}
		ret.Add(fmt.Sprintf("%s/%s", proj, console))
	}
	retSlice := ret.ToSlice()
	sort.Strings(retSlice)
	return retSlice, nil
}
1250878
func (p *PushEvent) GetDistinctSize() int {
	if p == nil || p.DistinctSize == nil {
		return 0
	}
	return *p.DistinctSize
}
951951
func (c *Client) GetMeasurements(ctx context.Context, db string, limit, offset int) ([]chronograf.Measurement, error) {
	return c.showMeasurements(ctx, db, limit, offset)
}
681529
func (window *Window) GetMinimumSize() (w, h int32) {
	var _w, _h C.int
	C.SDL_GetWindowMinimumSize(window.cptr(), &_w, &_h)
	return int32(_w), int32(_h)
}
808169
func (o *Out) GetTtySize() (uint, uint) {
	if !o.isTerminal {
		return 0, 0
	}
	ws, err := term.GetWinsize(o.fd)
	if err != nil {
		logrus.Debugf("Error getting size: %s", err)
		if ws == nil {
			return 0, 0
		}
	}
	return uint(ws.Height), uint(ws.Width)
}
1291708
func (co *Context) GetRNNWorkspaceSize(rnnDesc *RNN, seqLength int, xDesc []*TensorDescriptor) (sizeInBytes uintptr, err error) {
	var sizeInBytesC C.size_t
	if len(xDesc) != seqLength {
		return 0, errors.Errorf("Incorrect xDesc length. Want %d. Got %d", seqLength, len(xDesc))
	}

	internals := make([]C.cudnnTensorDescriptor_t, len(xDesc))
	for i := range xDesc {
		internals[i] = xDesc[i].internal
	}
	ptr := (*C.cudnnTensorDescriptor_t)(unsafe.Pointer(&internals[0]))

	// call cudnnGetRNNWorkspaceSize
	err = result(C.cudnnGetRNNWorkspaceSize(co.internal, rnnDesc.internal, C.int(seqLength), ptr, &sizeInBytesC))
	sizeInBytes = uintptr(sizeInBytesC)
	return
}