// NewAutoEscapeExtension returns an AutoEscapeExtension with Twig equivalent
// Escapers, by default.
179922
func NewAutoEscapeExtension() *AutoEscapeExtension {
	return &AutoEscapeExtension{
		Escapers: map[string]Escaper{
			"html":      escape.HTML,
			"html_attr": escape.HTMLAttribute,
			"js":        escape.JS,
			"css":       escape.CSS,
			"url":       escape.URLQueryParam,
		},
	}
}
894129
func constraintTargetEscapes(target string) bool {
	switch {
	case strings.HasPrefix(target, "${node.unique."):
		return true
	case strings.HasPrefix(target, "${attr.unique."):
		return true
	case strings.HasPrefix(target, "${meta.unique."):
		return true
	default:
		return false
	}
}
783235
func NewFromInterface(subjectAccessReview authorizationclient.SubjectAccessReviewInterface, authorizedTTL, unauthorizedTTL time.Duration) (*WebhookAuthorizer, error) {
	return newWithBackoff(subjectAccessReview, authorizedTTL, unauthorizedTTL, retryBackoff)
}
419186
func (a *Account) AutoExpireTTL() time.Duration {
	a.mu.RLock()
	defer a.mu.RUnlock()
	return a.maxaettl
}
973228
func NewExposeDevToolsProtocolArgs(targetID ID) *ExposeDevToolsProtocolArgs {
	args := new(ExposeDevToolsProtocolArgs)
	args.TargetID = targetID
	return args
}
132188
func NewAutoProvider(constructor interface{}) Provider {
	fnValue := reflect.ValueOf(constructor)
	if fnValue.Kind() != reflect.Func {
		panic("constructor is not a function")
	}

	fnType := reflect.TypeOf(constructor)
	if fnType.NumOut() != 1 {
		panic("constructor must have exactly 1 return value")
	}

	return autoProvider{
		constructor: constructor,
	}
}
1210305
func ManifestURLsAllowRegexp(r *regexp.Regexp) RegistryOption {
	return func(registry *registry) error {
		registry.manifestURLs.allow = r
		return nil
	}
}
777759
func (adapter *Encoder) SetEscapeHTML(escapeHTML bool) {
	config := adapter.stream.cfg.configBeforeFrozen
	config.EscapeHTML = escapeHTML
	adapter.stream.cfg = config.frozeWithCacheReuse(adapter.stream.cfg.extraExtensions)
}
1232087
func NewAddScriptToEvaluateOnNewDocumentArgs(source string) *AddScriptToEvaluateOnNewDocumentArgs {
	args := new(AddScriptToEvaluateOnNewDocumentArgs)
	args.Source = source
	return args
}
409530
func (p *PathSpec) URLEscape(uri string) string {
	// escape unicode letters
	parsedURI, err := url.Parse(uri)
	if err != nil {
		// if net/url can not parse URL it means Sanitize works incorrectly
		panic(err)
	}
	x := parsedURI.String()
	return x
}
811521
func EscapeGlobComponent(component string, options *Options) string {
	if options == nil {
		options = DefaultOptions
	}

	runesToEscape := make([]rune, 0, len(expanders)+1)
	runesToEscape = append(runesToEscape, expanders...)
	runesToEscape = append(runesToEscape, options.Separator)

	runesToEscapeMap := make(map[string]bool, len(runesToEscape))
	for _, r := range runesToEscape {
		runesToEscapeMap[string(r)] = true
	}

	scanner := bufio.NewScanner(strings.NewReader(component))
	scanner.Split(separatorsScanner(runesToEscape))
	buf := new(bytes.Buffer)
	for scanner.Scan() {
		component := scanner.Text()
		if runesToEscapeMap[component] {
			buf.WriteRune(Escaper)
		}
		buf.WriteString(component)
	}

	return buf.String()
}
1316362
func NewExplainService(client *Client) *ExplainService {
	return &ExplainService{
		client:         client,
		typ:            "_doc",
		xSource:        make([]string, 0),
		xSourceExclude: make([]string, 0),
		fields:         make([]string, 0),
		xSourceInclude: make([]string, 0),
	}
}
254910
func (s *Sprocket) PushBackAlterExtension(ext, alterExt string) {
	s.getOrCreateExtensionInfo(ext).AlterExts.PushBackUniq(alterExt)
}
726527
func NewExternalFacade(context facade.Context) (*Facade, error) {
	st := context.State()
	auth := context.Auth()

	m, err := st.Model()
	if err != nil {
		return nil, err
	}

	claimer, err := context.SingularClaimer()
	if err != nil {
		return nil, errors.Trace(err)
	}

	backend := getBackend(st, m.ModelTag())
	return NewFacade(backend, claimer, auth)
}
1335661
func NewAuthenticator(ca tlsgen.CA) *Authenticator {
	return &Authenticator{
		mapper: newCertMapper(ca.NewClientCertKeyPair),
	}
}
279127
func URLQueryEscape(origin string) string {
	escaped := url.QueryEscape(origin)
	escaped = strings.Replace(escaped, "%2F", "/", -1)
	escaped = strings.Replace(escaped, "%3D", "=", -1)
	escaped = strings.Replace(escaped, "+", "%20", -1)
	return escaped
}
328714
func ExpandWithDefault(link *Hyperlink, defaultLink *Hyperlink, params M) (u *url.URL, err error) {
	if link == nil {
		link = defaultLink
	}

	return link.Expand(params)
}