// QueryAttemptsForQuest returns all Attempt objects that exist for this Quest.
434611
func QueryAttemptsForQuest(c context.Context, qid string) *ds.Query {
	from := ds.MakeKey(c, "Attempt", qid+"|")
	to := ds.MakeKey(c, "Attempt", qid+"~")
	return ds.NewQuery("Attempt").Gt("__key__", from).Lt("__key__", to)
}
462906
func (c *Context) Query(name string, defaultValue ...string) string {
	if vs, _ := c.Request.URL.Query()[name]; len(vs) > 0 {
		return vs[0]
	}
	if len(defaultValue) > 0 {
		return defaultValue[0]
	}
	return ""
}
1281528
func (o *GetConsentRequestParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

	if err := r.SetTimeout(o.timeout); err != nil {
		return err
	}
	var res []error

	// query param consent_challenge
	qrConsentChallenge := o.ConsentChallenge
	qConsentChallenge := qrConsentChallenge
	if qConsentChallenge != "" {
		if err := r.SetQueryParam("consent_challenge", qConsentChallenge); err != nil {
			return err
		}
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
786288
func (tx *Tx) Query(q interface{}, args ...interface{}) (*Rows, error) {
	return tx.QueryContext(tx.Context(), q, args...)
}
121926
func AttemptRangeQuery(quest string, low, high uint32) *GraphQuery {
	return &GraphQuery{
		AttemptRange: []*GraphQuery_AttemptRange{{Quest: quest, Low: low, High: high}}}
}
53866
func Query(query url.Values) RequestOption {
	return func(req *http.Request) error {
		req.URL.RawQuery = query.Encode()
		return nil
	}
}
1102813
func TasksQueryURI(query string, offset int) string {
	if query != "" {
		return fmt.Sprintf("tasks?sort=NAME&query=%s&offset=%d", query, offset)
	}
	return fmt.Sprintf("tasks?offset=%d", offset)
}
845779
func (s *Store) Query(qr *QueryRequest) (*QueryResponse, error) {
	return s.query(nil, qr)
}
1324189
func (s *RetryStrategy) SetAttempts(v int64) *RetryStrategy {
	s.Attempts = &v
	return s
}
1346864
func (d *MapDatastore) Query(q dsq.Query) (dsq.Results, error) {
	re := make([]dsq.Entry, 0, len(d.values))
	for k, v := range d.values {
		e := dsq.Entry{Key: k.String()}
		if !q.KeysOnly {
			e.Value = v
		}
		re = append(re, e)
	}
	r := dsq.ResultsWithEntries(q, re)
	r = dsq.NaiveQueryApply(q, r)
	return r, nil
}
17218
func (tx *TX) QueryAll(stmt Executable, i interface{}) error {
	result, err := tx.Query(stmt)
	if err != nil {
		return err
	}
	return result.All(i)
}
197480
func (a *Authenticator) AuthenticateRequest(req *http.Request) (*authenticator.Response, bool, error) {
	username, password, found := req.BasicAuth()
	if !found {
		return nil, false, nil
	}

	resp, ok, err := a.auth.AuthenticatePassword(req.Context(), username, password)

	// If the password authenticator didn't error, provide a default error
	if !ok && err == nil {
		err = errInvalidAuth
	}

	return resp, ok, err
}
31516
func HTTPRequestFromContext(ctx context.Context) *http.Request {
	req, _ := ctx.Value(httpRequestContextKey).(*http.Request)
	return req
}
285537
func (c *Client) QueryRaw(ctx context.Context, req *search.SearchQuery) ([]byte, error) {
	hres, err := c.query(ctx, req)
	if err != nil {
		return nil, err
	}
	defer hres.Body.Close()
	return ioutil.ReadAll(hres.Body)
}
63209
func (c *Context) QueryArray(key string) []string {
	values, _ := c.GetQueryArray(key)
	return values
}
919755
func QueryForUniqueEntry(clientConfig ldapclient.Config, query *ldap.SearchRequest) (*ldap.Entry, error) {
	result, err := QueryForEntries(clientConfig, query)
	if err != nil {
		return nil, err
	}

	if len(result) == 0 {
		return nil, NewEntryNotFoundError(query.BaseDN, query.Filter)
	}

	if len(result) > 1 {
		if query.Scope == ldap.ScopeBaseObject {
			return nil, fmt.Errorf("multiple entries found matching dn=%q:\n%s",
				query.BaseDN, formatResult(result))
		} else {
			return nil, fmt.Errorf("multiple entries found matching filter %s:\n%s",
				query.Filter, formatResult(result))
		}
	}

	entry := result[0]
	klog.V(4).Infof("found dn=%q for %s", entry.DN, query.Filter)
	return entry, nil
}
749154
func (s *SQLiteStmt) QueryContext(ctx context.Context, args []driver.NamedValue) (driver.Rows, error) {
	list := make([]namedValue, len(args))
	for i, nv := range args {
		list[i] = namedValue(nv)
	}
	return s.query(ctx, list)
}