// NewRowRange is TODO
178707
func NewRowRange(startRow, stopRow []byte, startRowInclusive, stopRowInclusive bool) *RowRange {
	return &RowRange{
		StartRow:          startRow,
		StartRowInclusive: proto.Bool(startRowInclusive),
		StopRow:           stopRow,
		StopRowInclusive:  proto.Bool(stopRowInclusive),
	}
}
578785
func copyRows(rows []map[string]dosa.FieldValue) []map[string]dosa.FieldValue {
	copied := make([]map[string]dosa.FieldValue, len(rows))
	for i, row := range rows {
		copied[i] = copyRow(row)
	}
	return copied
}
316595
func (a *MinMaxAllocator) SetRange(min, max int) error {
	if min > max {
		return ErrInvalidRange
	}

	a.lock.Lock()
	defer a.lock.Unlock()

	// Check if we need to change
	if a.min == min && a.max == max {
		return nil
	}

	a.min = min
	a.max = max

	// Recompute how many free we have in the range
	numUsed := 0
	for i := range a.used {
		if a.inRange(i) {
			numUsed++
		}
	}
	a.free = 1 + max - min - numUsed

	return nil
}
648391
func NewMultiRowRangeFilter(rowRangeList []*RowRange) *MultiRowRangeFilter {
	rangeList := make([]*pb.RowRange, len(rowRangeList))
	for i, rr := range rowRangeList {
		rangeList[i] = (*pb.RowRange)(rr)
	}
	return &MultiRowRangeFilter{
		RowRangeList: rangeList,
	}
}
53310
func (s *GetJobOutputInput) SetRange(v string) *GetJobOutputInput {
	s.Range = &v
	return s
}
4442
func NewRow(ratio float64, i ...interface{}) GridItem {
	_, ok := i[0].(Drawable)
	entry := i[0]
	if !ok {
		entry = i
	}
	return GridItem{
		Type:   row,
		Entry:  entry,
		IsLeaf: ok,
		ratio:  ratio,
	}
}
1233418
func NewRowDecoder(tbl table.Table, decodeColMap map[int64]Column) *RowDecoder {
	colFieldMap := make(map[int64]*types.FieldType, len(decodeColMap))
	haveGenCol := false
	for id, col := range decodeColMap {
		colFieldMap[id] = &col.Col.ColumnInfo.FieldType
		if col.GenExpr != nil {
			haveGenCol = true
		}
	}
	if !haveGenCol {
		return &RowDecoder{
			colTypes: colFieldMap,
		}
	}

	cols := tbl.Cols()
	tps := make([]*types.FieldType, len(cols))
	for _, col := range cols {
		tps[col.Offset] = &col.FieldType
	}
	return &RowDecoder{
		tbl:           tbl,
		mutRow:        chunk.MutRowFromTypes(tps),
		columns:       decodeColMap,
		colTypes:      colFieldMap,
		haveGenColumn: haveGenCol,
		defaultVals:   make([]types.Datum, len(cols)),
	}
}
511078
func NewRangeFrom(from int) (*Range, error) {
	return (&rangeBuilder{}).from(from, nil).Range()
}
777595
func (t *Table) AddRow(data ...interface{}) *Table {
	t.mtx.Lock()
	defer t.mtx.Unlock()
	r := NewRow(data...)
	t.Rows = append(t.Rows, r)
	return t
}
310569
func (s *SeqSet) AddRange(Start, Stop uint32) {
	if (Stop < Start && Stop != 0) || Start == 0 {
		s.insert(Seq{Stop, Start})
	} else {
		s.insert(Seq{Start, Stop})
	}
}
1278453
func NewColumnRangeFilter(minColumn, maxColumn []byte,
	minColumnInclusive, maxColumnInclusive bool) *ColumnRangeFilter {
	return &ColumnRangeFilter{
		MinColumn:          minColumn,
		MaxColumn:          maxColumn,
		MinColumnInclusive: proto.Bool(minColumnInclusive),
		MaxColumnInclusive: proto.Bool(maxColumnInclusive),
	}
}
250891
func (c *Connector) Range(ctx context.Context, ei *dosa.EntityInfo, columnConditions map[string][]*dosa.Condition, minimumFields []string, token string, limit int) ([]map[string]dosa.FieldValue, string, error) {
	if limit == dosa.AdaptiveRangeLimit {
		limit = defaultRangeLimit
	}
	vals := make([]map[string]dosa.FieldValue, limit)
	for inx := range vals {
		vals[inx] = Data(ei, minimumFields)
	}
	return vals, randomString(32), nil
}
925336
func newRows(qr *sqltypes.Result, c *converter) driver.Rows {
	return &rows{qr: qr, convert: c}
}
342421
func newLimitRanges(c *Client, namespace string) *limitRanges {
	return &limitRanges{
		r:  c,
		ns: namespace,
	}
}
670351
func (c *shellQueryClient) Range(ctx context.Context, ops []*queryObj, fields []string, limit int) ([]map[string]dosa.FieldValue, error) {
	// look up the entity in the registry
	re, _ := c.registrar.Find(&dosa.Entity{})

	// build range operator with expressions and limit number
	r, err := buildRangeOp(ops, limit)
	if err != nil {
		return nil, err
	}

	// now convert the client range columns to server side column conditions structure
	columnConditions, err := dosa.ConvertConditions(r.Conditions(), re.Table())
	if err != nil {
		return nil, err
	}

	// convert the field names to column names
	columns, err := re.ColumnNames(fields)
	if err != nil {
		return nil, err
	}

	// call the server side method
	values, _, err := c.connector.Range(ctx, re.EntityInfo(), columnConditions, columns, "", r.LimitRows())
	if err != nil {
		return nil, err
	}

	return convertColToField(values, re.Table().ColToField), err
}
1260361
func CreateRow(items []interface{}) *Row {
	row := &Row{cells: []*Cell{}}
	for _, item := range items {
		row.AddCell(item)
	}
	return row
}
642020
func (g GridType) XRange() (min, max float64) {
	min = g.xTicks[0]
	max = g.xTicks[len(g.xTicks)-1]
	return
}