// NewContext returns a new Context carrying contextual log message
// that gets prefixed to log statements.
166319
func NewContext(ctx context.Context, msg string) context.Context {
	return context.WithValue(ctx, logContextKey, msg)
}
256890
func NewContext() *Context {
	ctx := &Context{Context: duktape.New()}
	ctx.storage = newStorage()
	ctx.pushGlobalCandyJSObject()

	return ctx
}
1092850
func NewContext(component seesaw.Component) *Context {
	return &Context{
		AuthType: ATNone,
		Peer: Peer{
			Component: component,
			Identity:  fmt.Sprintf("%s [pid %d]", component, os.Getpid()),
		},
	}
}
601305
func NewContext(ctx context.Context, rw http.ResponseWriter, req *http.Request, params url.Values) context.Context {
	if ctx == nil {
		ctx = context.Background()
	}
	request := &RequestData{Request: req, Params: params}
	response := &ResponseData{ResponseWriter: rw}
	ctx = context.WithValue(ctx, respKey, response)
	ctx = context.WithValue(ctx, reqKey, request)

	return ctx
}
998267
func newContext(c *cli.Context) (ctx *Context, err error) {
	ctx = &Context{
		Context: c,
		netCtx:  context.Background(),
	}

	ctx.reporter, err = newReporter(ctx)
	if err != nil {
		return
	}

	ctx.logger, err = newLogger(ctx)
	if err != nil {
		return
	}

	ctx.stats, err = newStats(ctx)
	if err != nil {
		return
	}

	ctx.netCtx = ctx.embed(ctx.netCtx)

	return
}
181677
func NewContext(ctx context.Context, logger KayveeLogger) context.Context {
	return context.WithValue(ctx, loggerKey, logger)
}
1275056
func newContext(t time.Duration) context.Context {
	ctx := context.Background()
	if t > 0 {
		ctx, _ = context.WithTimeout(ctx, t)
	}
	return ctx
}
1270329
func NewContext(label string) (Context, error) {
	c := make(Context)

	if len(label) != 0 {
		con := strings.SplitN(label, ":", 4)
		if len(con) < 3 {
			return c, InvalidLabel
		}
		c["user"] = con[0]
		c["role"] = con[1]
		c["type"] = con[2]
		if len(con) > 3 {
			c["level"] = con[3]
		}
	}
	return c, nil
}
293888
func NewContext(mode ...int) *Context {
	context := &Context{
		Iterations:  3,
		Memory:      1 << 12, // 4 MiB
		Parallelism: 1,
		HashLen:     32,
		Mode:        ModeArgon2i,
		Version:     VersionDefault,
	}
	if len(mode) >= 1 {
		context.Mode = mode[0]
	}
	return context
}
160093
func NewContext() *Context {
	ctx, cancel := context.WithCancel(context.Background())
	sctx := &Context{
		values:      make(map[fmt.Stringer]interface{}),
		sessionVars: variable.NewSessionVars(),
		ctx:         ctx,
		cancel:      cancel,
	}
	sctx.sessionVars.InitChunkSize = 2
	sctx.sessionVars.MaxChunkSize = 32
	sctx.sessionVars.StmtCtx.TimeZone = time.UTC
	sctx.sessionVars.GlobalVarsAccessor = variable.NewMockGlobalAccessor()
	return sctx
}
294329
func NewContext(label string) (Context, error) {
	c := make(Context)
	return c, nil
}
107220
func NewContext(ctx context.Context, t *Tracer) context.Context {
	return context.WithValue(ctx, tracerKey, t)
}
528049
func NewContext() Context {
	ctx := Context{}
	smokingChoices := []randutil.Choice{
		{2, "Smoker"},
		{3, "Non-smoker"},
		{1, "Ex-smoker"}}
	sc, _ := randutil.WeightedChoice(smokingChoices)
	ctx.Smoker = sc.Item.(string)

	alcoholChoices := []randutil.Choice{
		{2, "Occasional"},
		{1, "Heavy"},
		{1, "None"}}
	ac, _ := randutil.WeightedChoice(alcoholChoices)
	ctx.Alcohol = ac.Item.(string)

	cholesterolChoices := []randutil.Choice{
		{3, "Optimal"},
		{1, "Near Optimal"},
		{2, "Borderline"},
		{1, "High"},
		{2, "Very High"}}
	cc, _ := randutil.WeightedChoice(cholesterolChoices)
	ctx.Cholesterol = cc.Item.(string)

	hc, _ := randutil.ChoiceString([]string{"Normal", "Pre-hypertension", "Hypertension"})
	ctx.Hypertention = hc

	dc, _ := randutil.ChoiceString([]string{"Normal", "Pre-diabetes", "Diabetes"})
	ctx.Diabetes = dc
	return ctx
}
571729
func NewContext(napnap *NapNap, req *http.Request, writer ResponseWriter) *Context {
	return &Context{
		NapNap:  napnap,
		Request: req,
		Writer:  writer,
	}
}
770206
func NewContextWithLogger(ctx context.Context, log *zap.Logger) context.Context {
	return context.WithValue(ctx, loggerKey, log)
}
557394
func NewContext(ctx context.Context, l log15.Logger) context.Context {
	return context.WithValue(ctx, loggerKey, l)
}
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
}