// initSize tries to detect the total stream size, setting u.size. If
// the size is not known, size is set to -1.
768228
func (f *chunk) initSize() {
	f.size = -1

	switch r := f.fd.(type) {
	case io.Seeker:
		pos, _ := r.Seek(0, 1)
		defer r.Seek(pos, 0)

		n, err := r.Seek(0, 2)
		if err != nil {
			return
		}
		f.size = n

		// Try to adjust partSize if it is too small and account for
		// integer division truncation.
		if f.size/int64(f.partSize) >= int64(maxUploadParts) {
			// Add one to the part size to account for remainders
			// during the size calculation. e.g odd number of bytes.
			f.partSize = int(f.size/int64(maxUploadParts)) + 1
		}
	}
}
1085191
func (s *DescribeDBLogFilesInput) SetFileSize(v int64) *DescribeDBLogFilesInput {
	s.FileSize = &v
	return s
}
698235
func (s *LexiconAttributes) SetSize(v int64) *LexiconAttributes {
	s.Size = &v
	return s
}
882644
func FileSize(file string) (int64, error) {
	f, err := os.Stat(file)
	if err != nil {
		return 0, err
	}
	return f.Size(), nil
}
99483
func (dd *dictDecoder) histSize() int {
	if dd.full {
		return len(dd.hist)
	}
	return dd.wrPos
}
574971
func VarintSize(num int) int {
	bits := bits.Len(uint(num))
	q, r := bits/7, bits%7
	size := q
	if r > 0 || size == 0 {
		size++
	}
	return size
}
940645
func (s *ArrayProperties) SetSize(v int64) *ArrayProperties {
	s.Size = &v
	return s
}
849321
func (it *Materialize) Size() (int64, bool) {
	if it.hasRun && !it.aborted {
		if clog.V(2) {
			clog.Infof("returning size %v", it.actualSize)
		}
		return it.actualSize, true
	}
	if clog.V(2) {
		clog.Infof("bailing size %v", it.actualSize)
	}
	return it.subIt.Size()
}
530088
func (s *DashboardEntry) SetSize(v int64) *DashboardEntry {
	s.Size = &v
	return s
}
989216
func (s *Dynamic) SetSize(n int64) error {
	s.mu.Lock()
	defer s.mu.Unlock()
	s.size = n
	return nil
}
1127654
func (p *Init) Resize(ws console.WinSize) error {
	p.mu.Lock()
	defer p.mu.Unlock()

	if p.console == nil {
		return nil
	}
	return p.console.Resize(ws)
}
575782
func initTtySize(ctx context.Context, cli command.Cli, id string, isExec bool, resizeTtyFunc func(ctx context.Context, cli command.Cli, id string, isExec bool) error) {
	rttyFunc := resizeTtyFunc
	if rttyFunc == nil {
		rttyFunc = resizeTty
	}
	if err := rttyFunc(ctx, cli, id, isExec); err != nil {
		go func() {
			var err error
			for retry := 0; retry < 5; retry++ {
				time.Sleep(10 * time.Millisecond)
				if err = rttyFunc(ctx, cli, id, isExec); err == nil {
					break
				}
			}
			if err != nil {
				fmt.Fprintln(cli.Err(), "failed to resize tty, using default size")
			}
		}()
	}
}
237134
func parseSize(sizeStr string, uMap unitMap) (int64, error) {
	matches := sizeRegex.FindStringSubmatch(sizeStr)
	fmt.Println(matches)
	if len(matches) != 3 {
		return -1, fmt.Errorf("invalid size: '%s'", sizeStr)
	}

	size, err := strconv.ParseInt(matches[1], 10, 0)
	if err != nil {
		return -1, err
	}

	unitPrefix := strings.ToLower(matches[2])
	if mul, ok := uMap[unitPrefix]; ok {
		size *= mul
	}

	return size, nil
}
571241
func (p *PushEvent) GetSize() int {
	if p == nil || p.Size == nil {
		return 0
	}
	return *p.Size
}
1240613
func (c *Conn) wndSize() uint32 {
	if len(c.readBuf)+c.inboundWnd > readBufferLen {
		return 0
	}
	return uint32(readBufferLen - len(c.readBuf) - c.inboundWnd)
}
19368
func (p *PushEventRepository) GetSize() int {
	if p == nil || p.Size == nil {
		return 0
	}
	return *p.Size
}
860608
func (f *HttpFile) Size() int64 {
	DebugLog(f.Debug).Println("Size", f.len)
	return f.len
}