// New creates a duplicate Context object, merging the given data with the
// Context's data.
488175
func (c *Context) New(data Data) *Context {
	return newContext(c.Merge(data), c.Logger, c.TimeUnit, c.ErrorReporter, c._statter.dup())
}
1060548
func NewWithContext(source string, contextValues map[string]interface{}) KayveeLogger {
	context := M{}
	for k, v := range contextValues {
		updateContextMapIfNotReserved(context, k, v)
	}
	if os.Getenv("_DEPLOY_ENV") != "" {
		context["deploy_env"] = os.Getenv("_DEPLOY_ENV")
	}
	if os.Getenv("_EXECUTION_NAME") != "" {
		context["wf_id"] = os.Getenv("_EXECUTION_NAME")
	}
	if os.Getenv("_POD_ID") != "" {
		context["pod-id"] = os.Getenv("_POD_ID")
	}
	if os.Getenv("_POD_REGION") != "" {
		context["pod-region"] = os.Getenv("_POD_REGION")
	}
	if os.Getenv("_POD_ACCOUNT") != "" {
		context["pod-account"] = os.Getenv("_POD_ACCOUNT")
	}
	logObj := Logger{
		globals: context,
	}

	fl := defaultFormatLogger{}
	logObj.fLogger = &fl

	var logLvl LogLevel
	strLogLvl := os.Getenv("KAYVEE_LOG_LEVEL")
	if strLogLvl == "" {
		logLvl = Trace
	} else {
		for key, val := range logLevelNames {
			if strings.ToLower(strLogLvl) == val {
				logLvl = key
				break
			}
		}
	}

	logObj.SetConfig(source, logLvl, kv.Format, os.Stderr)

	return &logObj
}
1034024
func New(_ *runtime.Unknown, _ framework.Framework) (framework.Plugin, error) {
	return &CommunicatingPlugin{}, nil
}
810182
func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface {
	return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
}
294329
func NewContext(label string) (Context, error) {
	c := make(Context)
	return c, nil
}
1001696
func NewContextWithContext(name string, ctx context.Context) *Context {
	return &Context{
		Context: ctx,
		Name:    name,
		Args:    []string{},
		data:    map[interface{}]interface{}{},
		moot:    &sync.Mutex{},
	}
}
898564
func newContext(ctx context.Context, resource, name string, gvk schema.GroupVersionKind) context.Context {
	oldInfo, found := genericapirequest.RequestInfoFrom(ctx)
	if !found {
		return ctx
	}
	newInfo := genericapirequest.RequestInfo{
		IsResourceRequest: true,
		Verb:              "get",
		Namespace:         oldInfo.Namespace,
		Resource:          resource,
		Name:              name,
		Parts:             []string{resource, name},
		APIGroup:          gvk.Group,
		APIVersion:        gvk.Version,
	}
	return genericapirequest.WithRequestInfo(ctx, &newInfo)
}
871174
func New(params *stripe.TopupParams) (*stripe.Topup, error) {
	return getC().New(params)
}
1071479
func New(initializer Initializer, opts ...options.Opt) *Reference {
	return NewWithData(func(interface{}) (interface{}, error) {
		return initializer()
	}, opts...)
}
1249656
func NewContext() (*Context, error) {
	context := new(Context)
	err := tspiError(C.Tspi_Context_Create(&context.context))
	return context, err
}
371695
func New(name string) (s *Application) {
	s = NewWithContext(name, nil)
	globalApp[name] = s
	return
}
1114464
func New(c *Options) (s *Server) {
	c.ensure()
	s = &Server{
		cfg:    c,
		Logger: log.Get(PkgName),
		Binder: new(binder),
		router: router.New(router.Options{}),
		routes: make(map[string]router.Route),
	}
	s.stdLogger = slog.New(s.Logger, "web > ", 0)
	s.ctxPool = newContextPool(s)
	return s
}
342585
func New() (interface{}, error) {
	db := new()
	dbType := dbplugin.NewDatabaseErrorSanitizerMiddleware(db, db.secretValues)

	return dbType, nil
}
861090
func New() *Future {
	return &Future{
		Data:            new(sync.Map),
		completeChannel: make(chan struct{}),
		cancelChannel:   make(chan struct{}),
	}
}
836138
func New(ctx context.Context, h HandlerC) http.Handler {
        return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
                h.ServeHTTPC(ctx, w, r.WithContext(ctx))
        })
}
762332
func New(jsonReferenceString string) (Ref, error) {

	var r Ref
	err := r.parse(jsonReferenceString)
	return r, err

}
221425
func New(c Config) context.Handler {
	if len(c.Languages) == 0 {
		panic("You cannot use this middleware without set the Languages option, please try again and read the _example.")
	}
	i := &i18nMiddleware{config: c}
	firstlanguage := ""
	//load the files
	for k, langFileOrFiles := range c.Languages {
		// remove all spaces.
		langFileOrFiles = strings.Replace(langFileOrFiles, " ", "", -1)
		// note: if only one, then the first element is the "v".
		languages := strings.Split(langFileOrFiles, ",")

		for _, v := range languages { // loop each of the files separated by comma, if any.
			if !strings.HasSuffix(v, ".ini") {
				v += ".ini"
			}
			err := i18n.SetMessage(k, v)
			if err != nil && err != i18n.ErrLangAlreadyExist {
				panic("Failed to set locale file'" + k + "' Error:" + err.Error())
			}
			if firstlanguage == "" {
				firstlanguage = k
			}
		}
	}
	// if not default language setted then set to the first of the i.config.Languages
	if c.Default == "" {
		c.Default = firstlanguage
	}

	i18n.SetDefaultLang(i.config.Default)
	return i.ServeHTTP
}