// LocationRangeBetween returns a LocationRange containing both a and b.
499663
func LocationRangeBetween(a, b *LocationRange) LocationRange {
	if a.file != b.file {
		panic("Cannot create a LocationRange between different files")
	}
	return MakeLocationRange(a.FileName, a.file, a.Begin, b.End)
}
687310
func (client *Client) getEndpointByLocation() string {
	locationClient := NewLocationClient(client.AccessKeyId, client.AccessKeySecret, client.securityToken)
	locationClient.SetDebug(true)
	return locationClient.DescribeOpenAPIEndpoint(client.regionID, client.serviceCode)
}
647582
func SequenceFromEncodedRange(start, end []byte) (Sequence, error) {
	if len(start) != len(end) {
		return nil, fmt.Errorf("byte slices must be the same length")
	}
	switch len(start) {
	case 2:
		return Sequence{
			Range{start[0], end[0]},
			Range{start[1], end[1]},
		}, nil
	case 3:
		return Sequence{
			Range{start[0], end[0]},
			Range{start[1], end[1]},
			Range{start[2], end[2]},
		}, nil
	case 4:
		return Sequence{
			Range{start[0], end[0]},
			Range{start[1], end[1]},
			Range{start[2], end[2]},
			Range{start[3], end[3]},
		}, nil
	}

	return nil, fmt.Errorf("invalid encoded byte length")
}
588044
func (lineInfo *DebugLineInfo) AllPCsBetween(begin, end uint64, excludeFile string, excludeLine int) ([]uint64, error) {
	if lineInfo == nil {
		return nil, NoSourceError
	}

	var (
		pcs      []uint64
		lastaddr uint64
		sm       = newStateMachine(lineInfo, lineInfo.Instructions)
	)

	for {
		if err := sm.next(); err != nil {
			if lineInfo.Logf != nil {
				lineInfo.Logf("AllPCsBetween error: %v", err)
			}
			break
		}
		if !sm.valid {
			continue
		}
		if sm.address > end {
			break
		}
		if (sm.address >= begin && sm.address > lastaddr) && sm.isStmt && ((sm.file != excludeFile) || (sm.line != excludeLine)) {
			lastaddr = sm.address
			pcs = append(pcs, sm.address)
		}
	}
	return pcs, nil
}
270300
func (c *Client) GetRange(key string, start, end int) (string, error) {
	v, err := c.execWithKey(true, "GETRANGE", key, start, end)
	if err != nil {
		return "", err
	}
	switch v.(type) {
	case string:
		return v.(string), nil
	}
	return "", ErrServerError
}
1331929
func (o *SharedNetworkResource) AddressRanges(info *bambou.FetchingInfo) (AddressRangesList, *bambou.Error) {

	var list AddressRangesList
	err := bambou.CurrentSession().FetchChildren(o, AddressRangeIdentity, &list, info)
	return list, err
}
429575
func (tr Ranges) addRangeInPlace(r Range) {
	if r.IsEmpty() {
		return
	}

	e := tr.findFirstNotBefore(r)
	for e != nil {
		lr := e.Value.(Range)
		ne := e.Next()
		if !lr.Overlaps(r) {
			break
		}
		r = r.Merge(lr)
		tr.sortedRanges.Remove(e)
		e = ne
	}
	if e == nil {
		tr.sortedRanges.PushBack(r)
		return
	}
	tr.sortedRanges.InsertBefore(r, e)
}
110112
func afterBetween(min time.Duration, max time.Duration) <-chan time.Time {
	rand := rand.New(rand.NewSource(time.Now().UnixNano()))
	d, delta := min, (max - min)
	if delta > 0 {
		d += time.Duration(rand.Int63n(int64(delta)))
	}
	return time.After(d)
}
731602
func (n *Node) ChangesBetween(from, to api.Version) ([]state.Change, error) {
	n.stopMu.RLock()
	defer n.stopMu.RUnlock()

	if from.Index > to.Index {
		return nil, errors.New("versions are out of order")
	}

	if !n.IsMember() {
		return nil, ErrNoRaftMember
	}

	// never returns error
	last, _ := n.raftStore.LastIndex()

	if to.Index > last {
		return nil, errors.New("last version is out of bounds")
	}

	pbs, err := n.raftStore.Entries(from.Index+1, to.Index+1, math.MaxUint64)
	if err != nil {
		return nil, err
	}

	var changes []state.Change
	for _, pb := range pbs {
		if pb.Type != raftpb.EntryNormal || pb.Data == nil {
			continue
		}
		r := &api.InternalRaftRequest{}
		err := proto.Unmarshal(pb.Data, r)
		if err != nil {
			return nil, errors.Wrap(err, "error umarshalling internal raft request")
		}

		if r.Action != nil {
			changes = append(changes, state.Change{StoreActions: r.Action, Version: api.Version{Index: pb.Index}})
		}
	}

	return changes, nil
}
295038
func AngleBetween(tip1, tail, tip2 geom.Coord) float64 {
	a1 := Angle(tail, tip1)
	a2 := Angle(tail, tip2)

	return Diff(a1, a2)
}
938662
func (h *HereError) Location() string {
	lastSlash := strings.LastIndex(h.loc, "/")
	secondLastSlash := strings.LastIndex(h.loc[:lastSlash], "/")

	return h.loc[secondLastSlash+1:]
}
1057995
func (api *PrivateDebugAPI) StorageRangeAt(ctx context.Context, blockHash common.Hash, txIndex int, contractAddress common.Address, keyStart hexutil.Bytes, maxResult int) (StorageRangeResult, error) {
	_, _, statedb, err := api.computeTxEnv(blockHash, txIndex, 0)
	if err != nil {
		return StorageRangeResult{}, err
	}
	st := statedb.StorageTrie(contractAddress)
	if st == nil {
		return StorageRangeResult{}, fmt.Errorf("account %x doesn't exist", contractAddress)
	}
	return storageRangeAt(st, keyStart, maxResult)
}
1216141
func (client *Client) locationConstraint() io.Reader {
	constraint := fmt.Sprintf(createBucketConfiguration, client.Region)
	return strings.NewReader(constraint)
}
1366705
func (m *MockClient) WalkRange(arg0 context.Context, arg1 *dosa.RangeOp, arg2 func(dosa.DomainObject) error) error {
	ret := m.ctrl.Call(m, "WalkRange", arg0, arg1, arg2)
	ret0, _ := ret[0].(error)
	return ret0
}
531128
func LineEnding(loc *LocationRange) LocationRange {
	return LocationRange{
		Begin:    loc.End,
		End:      Location{Line: loc.End.Line, Column: len(loc.file.lines[loc.End.Line-1])},
		FileName: loc.FileName,
		file:     loc.file,
	}
}
761059
func KeyRangeString(k *topodatapb.KeyRange) string {
	if k == nil {
		return "-"
	}
	return hex.EncodeToString(k.Start) + "-" + hex.EncodeToString(k.End)
}
215718
func (v *Vector) SetRange(start, end int, e Equaler) {
	switch l := end - start; {
	case l == 0:
		if !v.Relaxed && (start < v.min.pos || start >= v.max.pos) {
			panic(ErrOutOfRange)
		}
		return
	case l == 1:
		v.Set(start, e)
		return
	case l < 0:
		panic(ErrInvertedRange)
	}

	if !v.Relaxed && (start < v.min.pos || end > v.max.pos || start == v.max.pos) {
		panic(ErrOutOfRange)
	}

	// Do fast path complete vector replacement if possible.
	if start <= v.min.pos && v.max.pos <= end {
		v.t = llrb.Tree{}
		*v.min = position{pos: start, val: e}
		v.t.Insert(v.min)
		v.max.pos = end
		v.t.Insert(v.max)
		return
	}

	// Handle cases where the given range is entirely outside the vector.
	switch {
	case start >= v.max.pos:
		oldEnd := v.max.pos
		v.max.pos = end
		if start != oldEnd {
			prev := v.t.Floor(query(oldEnd)).(*position)
			if !prev.val.Equal(v.Zero) {
				v.t.Insert(&position{pos: oldEnd, val: v.Zero})
			}
		}
		last := v.t.Floor(query(start)).(*position)
		if !e.Equal(last.val) {
			v.t.Insert(&position{pos: start, val: e})
		}
		return
	case end < v.min.pos:
		if v.min.val.Equal(v.Zero) {
			v.min.pos = end
		} else {
			v.min = &position{pos: end, val: v.Zero}
			v.t.Insert(v.min)
		}
		fallthrough
	case end == v.min.pos:
		if e.Equal(v.min.val) {
			v.min.pos = start
		} else {
			v.min = &position{pos: start, val: e}
			v.t.Insert(v.min)
		}
		return
	}

	// Handle cases where the given range
	last := v.t.Floor(query(end)).(*position)
	deleteRangeInclusive(&v.t, start, end)
	switch {
	// is entirely within the existing vector;
	case v.min.pos < start && end <= v.max.pos:
		prev := v.t.Floor(query(start)).(*position)
		if !e.Equal(prev.val) {
			v.t.Insert(&position{pos: start, val: e})
		}
		if last.val == nil {
			v.t.Insert(v.max)
		} else if !e.Equal(last.val) {
			v.t.Insert(&position{pos: end, val: last.val})
		}

	// hangs over the left end and the right end is in the vector; or
	case start <= v.min.pos:
		lastVal := last.val
		*v.min = position{pos: start, val: e}
		v.t.Insert(v.min)

		if !e.Equal(lastVal) {
			v.t.Insert(&position{pos: end, val: lastVal})
		}

	// hangs over the right end and the left end is in the vector.
	case end > v.max.pos:
		v.max.pos = end
		v.t.Insert(v.max)

		prev := v.t.Floor(query(start)).(*position)
		if e.Equal(prev.val) {
			return
		}
		if last.val == nil || !e.Equal(last.val) {
			v.t.Insert(&position{pos: start, val: e})
		}

	default:
		panic("step: unexpected case")
	}
}