//See: http://godoc.org/labix.org/v2/mgo#Query.Limit
425793
func (self *Query) Limit(limit int) *Query {

	self.limit = limit

	return self
}
888759
func (c *BotTasksCall) Limit(limit int64) *BotTasksCall {
	c.urlParams_.Set("limit", fmt.Sprint(limit))
	return c
}
6633
func (statement *Statement) Limit(limit int, start ...int) *Statement {
	statement.LimitN = limit
	if len(start) > 0 {
		statement.Start = start[0]
	}
	return statement
}
621804
func (session *Session) Limit(limit int, start ...int) *Session {
	session.statement.Limit(limit, start...)
	return session
}
127423
func Limit(limit int) p.Plugin {
	return p.NewRequestPlugin(func(ctx *c.Context, h c.Handler) {
		ctx.Client.CheckRedirect = func(req *http.Request, pool []*http.Request) error {
			return redirectPolicy(Options{Limit: limit}, req, pool)
		}
		h.Next(ctx)
	})
}
1095115
func (bldr *UserQueryBuilder) Limit(limit int) *UserQueryBuilder {
	bldr.q = bldr.q.Limit(limit)
	if bldr.plugin != nil {
		bldr.plugin.Limit(limit)
	}
	return bldr
}
188517
func (q *Query) Limit(amount uint) *Query {
	q.query.Limit(amount)
	return q
}
614524
func (p *Path) Limit(v int64) *Path {
	p.stack = append(p.stack, limitMorphism(v))
	return p
}
530872
func (r *RateLimiter) Limit(dataSize int) time.Duration {
	r.lock.Lock()
	defer r.lock.Unlock()
	//  update time
	var duration time.Duration = time.Duration(0)
	if r.bandwidth == 0 {
		return duration
	}
	current := time.Now()
	elapsedTime := current.Sub(r.lastUpdate)
	r.lastUpdate = current

	allowance := r.allowance + float64(elapsedTime)*r.bandwidth
	//  allowance can't exceed bandwidth
	if allowance > r.maxAllowance {
		allowance = r.maxAllowance
	}

	allowance -= float64(dataSize)
	if allowance < 0 {
		//  sleep until allowance is back to 0
		duration = time.Duration(-allowance / r.bandwidth)
		//  rate limiting was applied, record stats
		r.count++
		r.duration += duration
	}

	r.allowance = allowance
	return duration
}
1355352
func (p *queryPlan) limit() {
	if p.stm.IsLimitSet() {
		tracer.Trace(p.tracer, func() []string {
			return []string{"Limit results to " + strconv.Itoa(int(p.stm.Limit()))}
		})
		p.tbl.Limit(p.stm.Limit())
	}
}
862143
func (s *Salesforce) queryLimits() (*http.Response, error) {
	endpoint := fmt.Sprintf("%s://%s/services/data/v%s/limits", s.ServerURL.Scheme, s.ServerURL.Host, s.Version)
	req, err := http.NewRequest(http.MethodGet, endpoint, nil)
	if err != nil {
		return nil, err
	}
	req.Header.Add("Accept", "encoding/json")
	req.Header.Add("Authorization", "Bearer "+s.SessionID)
	return s.client.Do(req)
}
1170995
func (m *MockQuery) Limit(arg0 int) mongo.Query {
	ret := m.ctrl.Call(m, "Limit", arg0)
	ret0, _ := ret[0].(mongo.Query)
	return ret0
}
542889
func limit(limit int) scope {
	return scopeFunc(func(db *gorm.DB) *gorm.DB {
		return db.Limit(limit)
	})
}
1343889
func (q *MoreLikeThisQuery) MaxQueryTerms(maxQueryTerms int) *MoreLikeThisQuery {
	q.maxQueryTerms = &maxQueryTerms
	return q
}
599115
func (session *Session) Limit(limit int, start ...int) *Session {
	session.Statement.Limit(limit, start...)
	return session
}
626950
func (o *FindParams) WithLimit(limit int32) *FindParams {
	o.SetLimit(limit)
	return o
}
76961
func (mc MongoClient) IntervalActionsWithLimit(limit int) ([]contract.IntervalAction, error) {
	return mapIntervalActions(mc.getIntervalActionsLimit(bson.M{}, limit))
}