// GetBotInfoContext will retrieve the complete bot information using a custom context
548389
func (api *Client) GetBotInfoContext(ctx context.Context, bot string) (*Bot, error) {
	values := url.Values{
		"token": {api.token},
		"bot":   {bot},
	}

	response, err := api.botRequest(ctx, "bots.info", values)
	if err != nil {
		return nil, err
	}
	return &response.Bot, nil
}
73320
func (c *BotsCountCall) Context(ctx context.Context) *BotsCountCall {
	c.ctx_ = ctx
	return c
}
1044667
func (r *Region) GetContext() *kvrpcpb.Context {
	return &kvrpcpb.Context{
		RegionId:    r.meta.Id,
		RegionEpoch: r.meta.RegionEpoch,
		Peer:        r.peer,
	}
}
170030
func (c *BotTasksCall) Context(ctx context.Context) *BotTasksCall {
	c.ctx_ = ctx
	return c
}
157209
func (o *GetDebuginfoParams) WithContext(ctx context.Context) *GetDebuginfoParams {
	o.SetContext(ctx)
	return o
}
803692
func (n *NodeService) InfoWithContext(ctx context.Context) (*NodeInfo, *http.Response, error) {
	resource, _ := url.Parse(nodeInfoResourcePath)

	req, err := n.client.NewRequest(ctx, http.MethodGet, resource, nil)

	if err != nil {
		return nil, nil, err
	}

	nodeInfo := new(NodeInfo)

	res, err := n.client.Do(req, nodeInfo)

	if err != nil {
		return nil, res, err
	}

	return nodeInfo, res, nil
}
879777
func (o *GetMapNameParams) WithContext(ctx context.Context) *GetMapNameParams {
	o.SetContext(ctx)
	return o
}
224208
func (s *ScanService) FetchSourceContext(fetchSourceContext *FetchSourceContext) *ScanService {
	s.searchSource = s.searchSource.FetchSourceContext(fetchSourceContext)
	return s
}
1100236
func (api *Client) GetConversationInfoContext(ctx context.Context, channelID string, includeLocale bool) (*Channel, error) {
	values := url.Values{
		"token":          {api.token},
		"channel":        {channelID},
		"include_locale": {strconv.FormatBool(includeLocale)},
	}
	response, err := api.channelRequest(ctx, "conversations.info", values)
	if err != nil {
		return nil, err
	}

	return &response.Channel, response.Err()
}
244763
func (f *fs) getContext() context.Context {
	// TODO: Make timeout configurable
	c, _ := context.WithTimeout(context.Background(), 10*time.Second)
	c = metadata.NewContext(
		c,
		metadata.Pairs("fsid", f.fsid),
	)
	return c
}
502721
func GetContext(sp *Spider, req *request.Request) *Context {
	ctx := contextPool.Get().(*Context)
	ctx.spider = sp
	ctx.Request = req
	return ctx
}
960743
func (info Info) GetBotByID(botID string) *Bot {
	for _, bot := range info.Bots {
		if bot.ID == botID {
			return &bot
		}
	}
	return nil
}
242613
func (p *JsonPath) inferContext() jsonContext {
	if len(*p) == 0 {
		return none
	}
	t := (*p)[len(*p)-1]
	switch t.(type) {
	case string:
		return objKey
	case int:
		return arrValue
	default:
		panic(fmt.Sprintf("Invalid stack type %T", t))
	}
}
598963
func (l *Logger) GetContext(key string) (interface{}, bool) {
	l.globalsL.RLock()
	defer l.globalsL.RUnlock()
	val, ok := l.globals[key]
	return val, ok
}
1196463
func (api *Client) GetUserPresenceContext(ctx context.Context, user string) (*UserPresence, error) {
	values := url.Values{
		"token": {api.token},
		"user":  {user},
	}

	response, err := api.userRequest(ctx, "users.getPresence", values)
	if err != nil {
		return nil, err
	}
	return &response.UserPresence, nil
}
690937
func (o *GetConsentRequestParams) WithContext(ctx context.Context) *GetConsentRequestParams {
	o.SetContext(ctx)
	return o
}
866537
func configForContext(context string, kubeconfig string) (*rest.Config, error) {
	config, err := kube.GetConfig(context, kubeconfig).ClientConfig()
	if err != nil {
		return nil, fmt.Errorf("could not get Kubernetes config for context %q: %s", context, err)
	}
	return config, nil
}