// getPongoContext returns the pongo2.Context from map[string]interface{} or from pongo2.Context, used internaly
334468
func getPongoContext(templateData interface{}) pongo2.Context {
	if templateData == nil {
		return nil
	}

	if contextData, isPongoContext := templateData.(pongo2.Context); isPongoContext {
		return contextData
	}

	if contextData, isContextViewData := templateData.(context.Map); isContextViewData {
		return pongo2.Context(contextData)
	}

	return templateData.(map[string]interface{})
}
355182
func (c *Cepgo) GlobalContext() (map[string]string, error) {
	rawContext, err := c.Key("/global_context/")
	if err != nil {
		return nil, err
	}

	return typeAssertToMapOfStrings(rawContext)
}
161060
func (tx *Tx) GetContext(ctx context.Context, dest interface{}, keys ...interface{}) error {
	return getObject(ctx, tx.DB, tx, dest, keys)
}
690937
func (o *GetConsentRequestParams) WithContext(ctx context.Context) *GetConsentRequestParams {
	o.SetContext(ctx)
	return o
}
259699
func (o *PetGetParams) WithContext(ctx context.Context) *PetGetParams {
	o.SetContext(ctx)
	return o
}
224208
func (s *ScanService) FetchSourceContext(fetchSourceContext *FetchSourceContext) *ScanService {
	s.searchSource = s.searchSource.FetchSourceContext(fetchSourceContext)
	return s
}
287819
func Context(ctx context.Context) RequestOpt {
	return func(r *http.Request) {
		r2 := r.WithContext(ctx)
		*r = *r2
	}
}
313907
func GetContext(log ttnlog.Interface, extraPairs ...string) context.Context {
	token, err := GetTokenSource(log).Token()
	if err != nil {
		log.WithError(err).Fatal("Could not get token")
	}
	ctx := context.Background()
	ctx = ttnctx.OutgoingContextWithID(ctx, GetID())
	ctx = ttnctx.OutgoingContextWithServiceInfo(ctx, "ttnctl", fmt.Sprintf("%s-%s (%s)", viper.GetString("version"), viper.GetString("gitCommit"), viper.GetString("buildDate")), "")
	ctx = ttnctx.OutgoingContextWithToken(ctx, token.AccessToken)
	return ctx
}
528193
func (d *Context) GetContext(index int) *Context {
	return contextFromPointer(C.duk_get_context(d.duk_context, C.duk_idx_t(index)))
}
1030482
func (api *Client) GetFileInfoContext(ctx context.Context, fileID string, count, page int) (*File, []Comment, *Paging, error) {
	values := url.Values{
		"token": {api.token},
		"file":  {fileID},
		"count": {strconv.Itoa(count)},
		"page":  {strconv.Itoa(page)},
	}

	response, err := api.fileRequest(ctx, "files.info", values)
	if err != nil {
		return nil, nil, nil, err
	}
	return &response.File, response.Comments, &response.Paging, nil
}
595301
func (w *Window) GetGLXContext() C.GLXContext {
	ret := C.glfwGetGLXContext(w.data)
	panicError()
	return ret
}
715004
func getContext(marker interface{}) *context {
	globals.lockContexts.Lock()
	defer globals.lockContexts.Unlock()
	if globals.contexts == nil {
		return nil
	}
	c, ok := globals.contexts[marker]
	if !ok {
		return &consts.defaultContext
	}
	return c
}
1000236
func (client *BaseClient) GetClientContext(
	settings *InvokeSettings) (context *ClientContext) {
	context = client.contextPool.Get().(*ClientContext)
	context.InitBaseContext()
	context.Client = client
	context.Retried = 0
	if client.UserData != nil {
		for k, v := range client.UserData {
			context.SetInterface(k, v)
		}
	}
	if settings == nil {
		context.InvokeSettings = InvokeSettings{
			Timeout: client.timeout,
			Retry:   client.retry,
		}
	} else {
		if settings.userData != nil {
			for k, v := range settings.userData {
				context.SetInterface(k, v)
			}
		}
		context.InvokeSettings = *settings
		if settings.Timeout <= 0 {
			context.Timeout = client.timeout
		}
		if settings.Retry <= 0 {
			context.Retry = client.retry
		}
	}
	return context
}
538944
func (g *getter) Context() context.Context {
	if g == nil || g.client == nil {
		return context.Background()
	}
	return g.client.Ctx
}
911554
func (c *GroupPercentGetCall) Context(ctx context.Context) *GroupPercentGetCall {
	c.ctx_ = ctx
	return c
}
1340159
func (c *ValidateConfigCall) Context(ctx context.Context) *ValidateConfigCall {
	c.ctx_ = ctx
	return c
}
77477
func (o *CiliumAPI) Context() *middleware.Context {
	if o.context == nil {
		o.context = middleware.NewRoutableContext(o.spec, o, nil)
	}

	return o.context
}