// New returns a new instance of the transform-namespaced template functions.
160894
func New(deps *deps.Deps) *Namespace {
	cache := namedmemcache.New()
	deps.BuildStartListeners.Add(
		func() {
			cache.Clear()
		})

	return &Namespace{
		cache: cache,
		deps:  deps,
	}
}
1059450
func New(cfg Collector, nodeInfo collectors.NodeInfo, ctr *mesosAgent.ContainerTaskRels) (Collector, chan producers.MetricsMessage) {
	c := cfg
	c.nodeInfo = nodeInfo
	c.metricsChan = make(chan producers.MetricsMessage)
	c.containerTaskRels = ctr
	return c, c.metricsChan
}
651362
func New(deps *deps.Deps) (*Namespace, error) {
	if deps.ResourceSpec == nil {
		return &Namespace{}, nil
	}

	scssClient, err := scss.New(deps.BaseFs.Assets, deps.ResourceSpec)
	if err != nil {
		return nil, err
	}
	return &Namespace{
		deps:            deps,
		scssClient:      scssClient,
		createClient:    create.New(deps.ResourceSpec),
		bundlerClient:   bundler.New(deps.ResourceSpec),
		integrityClient: integrity.New(deps.ResourceSpec),
		minifyClient:    minifier.New(deps.ResourceSpec),
		postcssClient:   postcss.New(deps.ResourceSpec),
		templatesClient: templates.New(deps.ResourceSpec, deps.TextTmpl),
	}, nil
}
1291260
func New(d *deps.Deps) *Namespace {
	titleCaseStyle := d.Cfg.GetString("titleCaseStyle")
	titleFunc := helpers.GetTitleFunc(titleCaseStyle)
	return &Namespace{deps: d, titleFunc: titleFunc}
}
924292
func New(deps *deps.Deps) *Namespace {
	return &Namespace{
		cache: map[string]image.Config{},
		deps:  deps,
	}
}
717146
func New(values ...interface{}) *Set {
	// Initialize set
	s := Set{
		m: make(map[interface{}]struct{}),
	}

	// If items are specified in the initializer, immediately add them to the set
	for _, v := range values {
		s.Add(v)
	}

	return &s
}
622956
func New(name string) *htmlTemplate.Template {
	return htmlTemplate.New(name).Funcs(GtfFuncMap)
}
172227
func New() Definition {
	var q Definition
	q.Where = make(map[string]interface{})
	q.Sort = make(map[string]interface{})
	return q
}
114352
func New(typ string) *Service {
	s := Service{
		Type:            typ,
		Characteristics: []*characteristic.Characteristic{},
		Linked:          []int64{},
	}

	return &s
}
374032
func New(options *Options, defaultRenderType string) *Renderer {
	r := render.New(render.Options(*options))
	return &Renderer{r, options, defaultRenderType}
}
1071479
func New(initializer Initializer, opts ...options.Opt) *Reference {
	return NewWithData(func(interface{}) (interface{}, error) {
		return initializer()
	}, opts...)
}
1194062
func New(cfg DepsCfg) (*Deps, error) {
	var (
		logger = cfg.Logger
		fs     = cfg.Fs
	)

	if cfg.TemplateProvider == nil {
		panic("Must have a TemplateProvider")
	}

	if cfg.TranslationProvider == nil {
		panic("Must have a TranslationProvider")
	}

	if cfg.Language == nil {
		panic("Must have a Language")
	}

	if logger == nil {
		logger = loggers.NewErrorLogger()
	}

	if fs == nil {
		// Default to the production file system.
		fs = hugofs.NewDefault(cfg.Language)
	}

	if cfg.MediaTypes == nil {
		cfg.MediaTypes = media.DefaultTypes
	}

	if cfg.OutputFormats == nil {
		cfg.OutputFormats = output.DefaultFormats
	}

	ps, err := helpers.NewPathSpec(fs, cfg.Language)

	if err != nil {
		return nil, err
	}

	fileCaches, err := filecache.NewCaches(ps)
	if err != nil {
		return nil, errors.WithMessage(err, "failed to create file caches from configuration")
	}

	resourceSpec, err := resources.NewSpec(ps, fileCaches, logger, cfg.OutputFormats, cfg.MediaTypes)
	if err != nil {
		return nil, err
	}

	contentSpec, err := helpers.NewContentSpec(cfg.Language)
	if err != nil {
		return nil, err
	}

	sp := source.NewSourceSpec(ps, fs.Source)

	timeoutms := cfg.Language.GetInt("timeout")
	if timeoutms <= 0 {
		timeoutms = 3000
	}

	distinctErrorLogger := helpers.NewDistinctLogger(logger.ERROR)
	distinctWarnLogger := helpers.NewDistinctLogger(logger.WARN)

	d := &Deps{
		Fs:                  fs,
		Log:                 logger,
		DistinctErrorLog:    distinctErrorLogger,
		DistinctWarningLog:  distinctWarnLogger,
		templateProvider:    cfg.TemplateProvider,
		translationProvider: cfg.TranslationProvider,
		WithTemplate:        cfg.WithTemplate,
		PathSpec:            ps,
		ContentSpec:         contentSpec,
		SourceSpec:          sp,
		ResourceSpec:        resourceSpec,
		Cfg:                 cfg.Language,
		Language:            cfg.Language,
		Site:                cfg.Site,
		FileCaches:          fileCaches,
		BuildStartListeners: &Listeners{},
		Timeout:             time.Duration(timeoutms) * time.Millisecond,
		globalErrHandler:    &globalErrHandler{},
	}

	if cfg.Cfg.GetBool("templateMetrics") {
		d.Metrics = metrics.NewProvider(cfg.Cfg.GetBool("templateMetricsHints"))
	}

	return d, nil
}
893647
func New(d *deps.Deps) *Namespace {
	return &Namespace{helpers.NewDistinctLogger(d.Log.ERROR)}
}
553407
func (r *TasksService) New(swarmingrpcsnewtaskrequest *SwarmingRpcsNewTaskRequest) *TasksNewCall {
	c := &TasksNewCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.swarmingrpcsnewtaskrequest = swarmingrpcsnewtaskrequest
	return c
}
468153
func (t *TimeSeries) New(chronograf.Source, chronograf.Logger) (chronograf.TimeSeries, error) {
	return t, nil
}
155242
func New(rs *resources.Spec, textTemplate tpl.TemplateParseFinder) *Client {
	if rs == nil {
		panic("must provice a resource Spec")
	}
	if textTemplate == nil {
		panic("must provide a textTemplate")
	}
	return &Client{rs: rs, textTemplate: textTemplate}
}
426371
func New(t T) *I {
	return &I{t, t.FailNow, os.Stdout, !noColorFlag}
}