// GetEndInBoth returns the value of EndInBoth if it is set or its
// zero value if it is unset.
977124
func (v *VersioningTestV2) GetEndInBoth() (o int32) {
	if v != nil && v.EndInBoth != nil {
		return *v.EndInBoth
	}

	return
}
77673
func NativeEndian() binary.ByteOrder {
	// Determine endianness by storing a uint16 in a byte slice.
	b := Uint16Bytes(1)
	if b[0] == 1 {
		return binary.LittleEndian
	}

	return binary.BigEndian
}
405959
func (l *b2Objects) GetObjectNInfo(ctx context.Context, bucket, object string, rs *minio.HTTPRangeSpec, h http.Header, lockType minio.LockType, opts minio.ObjectOptions) (gr *minio.GetObjectReader, err error) {
	var objInfo minio.ObjectInfo
	objInfo, err = l.GetObjectInfo(ctx, bucket, object, opts)
	if err != nil {
		return nil, err
	}

	var startOffset, length int64
	startOffset, length, err = rs.GetOffsetLength(objInfo.Size)
	if err != nil {
		return nil, err
	}

	pr, pw := io.Pipe()
	go func() {
		err := l.GetObject(ctx, bucket, object, startOffset, length, pw, objInfo.ETag, opts)
		pw.CloseWithError(err)
	}()
	// Setup cleanup function to cause the above go-routine to
	// exit in case of partial read
	pipeCloser := func() { pr.Close() }
	return minio.NewGetObjectReaderFromReader(pr, objInfo, opts.CheckCopyPrecondFn, pipeCloser)
}
89183
func (st modelManagerStateShim) GetBackend(modelUUID string) (ModelManagerBackend, func() bool, error) {
	otherState, err := st.pool.Get(modelUUID)
	if err != nil {
		return nil, nil, errors.Trace(err)
	}
	otherModel, err := otherState.Model()
	if err != nil {
		otherState.Release()
		return nil, nil, err
	}
	return modelManagerStateShim{otherState.State, otherModel, st.pool}, otherState.Release, nil
}
580090
func IsLittleEndian() bool {
	var i int32 = 0x01020304
	u := unsafe.Pointer(&i)
	pb := (*byte)(u)
	b := *pb
	return (b == 0x04)
}
821458
func (c *appContext) getDepthChart(w http.ResponseWriter, r *http.Request) {
	if c.xcBot == nil {
		http.Error(w, http.StatusText(http.StatusServiceUnavailable), http.StatusServiceUnavailable)
		return
	}
	token := m.RetrieveExchangeTokenCtx(r)
	if token == "" {
		http.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)
		return
	}

	chart, err := c.xcBot.QuickDepth(token)
	if err != nil {
		apiLog.Infof("QuickDepth error: %v", err)
		http.Error(w, http.StatusText(http.StatusNotFound), http.StatusNotFound)
		return
	}
	writeJSONBytes(w, chart)
}
624208
func (sb *sandbox) getGatewayEndpoint() *endpoint {
	for _, ep := range sb.getConnectedEndpoints() {
		if ep.getNetwork().Type() == "null" || ep.getNetwork().Type() == "host" {
			continue
		}
		if len(ep.Gateway()) != 0 {
			return ep
		}
	}
	return nil
}
1166495
func (b Box) GetBottom(defaults ...int) int {
	if !b.IsSet && b.Bottom == 0 {
		if len(defaults) > 0 {
			return defaults[0]
		}
		return 0
	}
	return b.Bottom
}
1080219
func GetEndpointByID(endpointId string) (*HostComputeEndpoint, error) {
	hcnQuery := defaultQuery()
	mapA := map[string]string{"ID": endpointId}
	filter, err := json.Marshal(mapA)
	if err != nil {
		return nil, err
	}
	hcnQuery.Filter = string(filter)

	endpoints, err := ListEndpointsQuery(hcnQuery)
	if err != nil {
		return nil, err
	}
	if len(endpoints) == 0 {
		return nil, EndpointNotFoundError{EndpointID: endpointId}
	}
	return &endpoints[0], err
}
784007
func (d *Document) FindEndOfCurrentWordUntilSeparator(sep string) int {
	if sep == "" {
		return d.FindEndOfCurrentWord()
	}

	x := d.TextAfterCursor()
	i := strings.IndexAny(x, sep)
	if i != -1 {
		return i
	}
	return len(x)
}
807313
func (b *bsiGroup) BitDepth() uint {
	for i := uint(0); i < 63; i++ {
		if b.Max-b.Min < (1 << i) {
			return i
		}
	}
	return 63
}
34299
func (g *Mutable) DeleteBoth(v, w int) {
	g.Delete(v, w)
	if v != w {
		g.Delete(w, v)
	}
}
662601
func (surface *XlibSurface) GetDepth() int {
	ret := int(C.cairo_xlib_surface_get_depth(surface.Ptr))
	if err := surface.status(); err != nil {
		panic(err)
	}
	return ret
}
740781
func (db *PublicRecord) GetEndorsement(txid *wire.ShaHash) (*ombjson.Endorsement, error) {
	row := db.selectEndo.QueryRow(txid.String())
	return scanEndo(row)
}
513389
func (ec *EthereumClient) GetPendingNonceAt(ctx *Context, account *Address) (nonce int64, _ error) {
	rawNonce, err := ec.client.PendingNonceAt(ctx.context, account.address)
	return int64(rawNonce), err
}
486533
func (b *PCMBuffer) calculateIntBitDepth() uint8 {
	if b == nil {
		return 0
	}
	bitDepth := b.SourceBitDepth
	if bitDepth != 0 {
		return bitDepth
	}
	var max int64
	switch b.DataType {
	case DataTypeI8:
		var i8max int8
		for _, s := range b.I8 {
			if s > i8max {
				i8max = s
			}
		}
		max = int64(i8max)
	case DataTypeI16:
		var i16max int16
		for _, s := range b.I16 {
			if s > i16max {
				i16max = s
			}
		}
		max = int64(i16max)
	case DataTypeI32:
		var i32max int32
		for _, s := range b.I32 {
			if s > i32max {
				i32max = s
			}
		}
		max = int64(i32max)
	default:
		// This method is only meant to be used on int buffers.
		return bitDepth
	}
	bitDepth = 8
	if max > 127 {
		bitDepth = 16
	}
	// greater than int16, expecting int24
	if max > 32767 {
		bitDepth = 24
	}
	// int 32
	if max > 8388607 {
		bitDepth = 32
	}
	// int 64
	if max > 4294967295 {
		bitDepth = 64
	}

	return bitDepth
}
507727
func (b *Box) GetInnerRect() (int, int, int, int) {
	if b.innerX >= 0 {
		return b.innerX, b.innerY, b.innerWidth, b.innerHeight
	}
	x, y, width, height := b.GetRect()
	if b.border {
		x++
		y++
		width -= 2
		height -= 2
	}
	return x + b.paddingLeft,
		y + b.paddingTop,
		width - b.paddingLeft - b.paddingRight,
		height - b.paddingTop - b.paddingBottom
}