// NewContext create cron context
343542
func NewContext(repository Repository) (Context, error) {
	ctx := &context{
		cronClient: map[string]*cron.Cron{},
		repository: repository,
	}
	data, err := repository.Load()
	if err != nil {
		return nil, err
	}
	ctx.cronTaskMap = data
	return ctx, nil
}
1304582
func NewContext(ctx context.Context, r *Registration, plugins *Set, root, state string) *InitContext {
	return &InitContext{
		Context: ctx,
		Root:    filepath.Join(root, r.URI()),
		State:   filepath.Join(state, r.URI()),
		Meta: &Meta{
			Exports: map[string]string{},
		},
		plugins: plugins,
	}
}
487315
func (c *Canceller) NewContext() (context.Context, context.CancelFunc) {
	return context.WithCancel(c.ctx)
}
284630
func NewContext(ctx context.Context, logger Logger) context.Context {
	return context.WithValue(ctx, "termlog", logger)
}
278907
func NewContext(l *LARS) *Ctx {

	c := &Ctx{
		params: make(Params, l.mostParams),
	}

	c.response = newResponse(nil, c)

	return c
}
142218
func NewContext(req engine.Request, res engine.Response, e *Echo) Context {
	c := &xContext{
		Validator:   DefaultNopValidate,
		Translator:  DefaultNopTranslate,
		Emitter:     emitter.DefaultCondEmitter,
		Transaction: DefaultNopTransaction,
		context:     context.Background(),
		request:     req,
		response:    res,
		echo:        e,
		pvalues:     make([]string, *e.maxParam),
		store:       make(Store),
		handler:     NotFoundHandler,
		funcs:       make(map[string]interface{}),
		sessioner:   DefaultSession,
	}
	c.cookier = NewCookier(c)
	c.dataEngine = NewData(c)
	return c
}
721029
func NewContext(app *App, set *flag.FlagSet, globalSet *flag.FlagSet) *Context {
	return &Context{App: app, flagSet: set, globalSet: globalSet}
}
492087
func NewContext() (retVal *Context) {
	var internal C.cudnnHandle_t
	if err := result(C.cudnnCreate(&internal)); err != nil {
		panic(err)
	}
	retVal = &Context{internal}
	return retVal
}
784399
func newContext(r *http.Request, w http.ResponseWriter, api string) context.Context {
	vars := mux.Vars(r)
	bucket := vars["bucket"]
	object := vars["object"]
	prefix := vars["prefix"]

	if prefix != "" {
		object = prefix
	}
	reqInfo := &logger.ReqInfo{
		DeploymentID: w.Header().Get(responseDeploymentIDKey),
		RequestID:    w.Header().Get(responseRequestIDKey),
		RemoteHost:   handlers.GetSourceIP(r),
		UserAgent:    r.UserAgent(),
		API:          api,
		BucketName:   bucket,
		ObjectName:   object,
	}
	return logger.SetReqInfo(context.Background(), reqInfo)
}
238697
func NewContextWriter(ctx context.Context, w io.Writer) io.Writer {
	return ctxio.NewWriter(ctx, w)
}
1275665
func NewContext(ctx context.Context, p *Peer) context.Context {
	return context.WithValue(ctx, peerKey{}, p)
}
859519
func NewContext(canvas *js.Object, ca *ContextAttributes) (*Context, error) {
	if js.Global.Get("WebGLRenderingContext") == js.Undefined {
		return nil, errors.New("Your browser doesn't appear to support webgl.")
	}

	if ca == nil {
		ca = DefaultAttributes()
	}

	attrs := map[string]bool{
		"alpha":                 ca.Alpha,
		"depth":                 ca.Depth,
		"stencil":               ca.Stencil,
		"antialias":             ca.Antialias,
		"premultipliedAlpha":    ca.PremultipliedAlpha,
		"preserveDrawingBuffer": ca.PreserveDrawingBuffer,
	}
	gl := canvas.Call("getContext", "webgl", attrs)
	if gl == nil {
		gl = canvas.Call("getContext", "experimental-webgl", attrs)
		if gl == nil {
			return nil, errors.New("Creating a webgl context has failed.")
		}
	}
	ctx := new(Context)
	ctx.Object = gl
	return ctx, nil
}
1058279
func newContext(ctx context.Context, query string) context.Context {
	return context.WithValue(ctx, queryKey, query)
}
110285
func NewContext() context.Context {
	md := metadata.Pairs("x-helm-api-client", version.GetVersion())
	return metadata.NewOutgoingContext(context.TODO(), md)
}
941303
func createContext(context interface{}) Context {
	var ctxt Context
	switch context.(type) {
	case *map[string]interface{}:
		ctxt = mapContext{*(context.(*map[string]interface{}))}
	case map[string]interface{}:
		ctxt = mapContext{(context.(map[string]interface{}))}
	case reflect.Value:
		rval := context.(reflect.Value)
		if rval.Kind() == reflect.Ptr {
			rval = rval.Elem()
		}
		ctxt = reflectContext{rval}
	case *reflect.Value:
		rval := *(context.(*reflect.Value))
		if rval.Kind() == reflect.Ptr {
			rval = rval.Elem()
		}
		ctxt = reflectContext{rval}
	default:
		var ok bool
		if context == nil {
			ctxt = nilContext{}
		} else {
			//A custom context can be used, resolve it
			ctxt, ok = context.(Context)
			if !ok {
				//Not a custom context, default to a reflect context
				rval := reflect.ValueOf(context)
				if rval.Kind() == reflect.Ptr {
					rval = rval.Elem()
				}
				ctxt = reflectContext{rval}
			}
		}
	}

	return ctxt
}
894271
func NewMockContext(ctrl *gomock.Controller) *MockContext {
	mock := &MockContext{ctrl: ctrl}
	mock.recorder = &MockContextMockRecorder{mock}
	return mock
}
256890
func NewContext() *Context {
	ctx := &Context{Context: duktape.New()}
	ctx.storage = newStorage()
	ctx.pushGlobalCandyJSObject()

	return ctx
}