// RenderL renders a specified template with go literal arguments.
172688
func (f *File) RenderL(templName string, params LiteralMap) (ret string, err error) {
	spec := &Specifier{TemplateName: templName}
	spec.Params, err = params.Convert()
	if err != nil {
		return
	}
	return f.Render(spec)
}
226831
func (set *TemplateSet) RenderTemplateString(s string, ctx Context) (string, error) {
	set.firstTemplateCreated = true

	tpl := Must(set.FromString(s))
	result, err := tpl.Execute(ctx)
	if err != nil {
		return "", err
	}
	return result, nil
}
657301
func render(temp string, args string) string {
	context := Context{args}
	tmpl, err := template.New("replacer").Parse(temp)
	if err != nil {
		fmt.Println("A problem occured parsing one of the processors:")
		fmt.Println(err)
		fmt.Print(temp)
		os.Exit(2)
	}
	buff := bytes.NewBufferString("")
	err = tmpl.Execute(buff, context)
	if err != nil {
		fmt.Println("A problem occured executing one of the processors:")
		fmt.Println(err)
		fmt.Print(temp)
		os.Exit(2)
	}
	return buff.String()
}
780807
func Render(input string, ctx *Context) (string, error) {
	t, err := Parse(input)
	if err != nil {
		return "", errors.WithStack(err)
	}
	return t.Exec(ctx)
}
427703
func (c *Client) renderOptions(opts []grpc.CallOption) (*Options, error) {
	var options *Options
	if c.Options != nil {
		cpy := *c.Options
		options = &cpy
	} else {
		options = DefaultOptions()
	}
	if err := options.apply(opts); err != nil {
		return nil, err
	}
	return options, nil
}
1054243
func (r *Render) compile() {
	for _, ts := range r.templates {
		fileList := make([]string, len(ts.fileList))
		for i, f := range ts.fileList {
			fileList[i] = path.Join(r.opt.Directory, f)
		}
		ts.template = template.New(ts.entry)
		ts.template.Delims(r.opt.Delims.Left, r.opt.Delims.Right)
		for _, funcs := range r.opt.Funcs {
			ts.template.Funcs(funcs)
		}
		ts.template = template.Must(ts.template.ParseFiles(fileList...))
	}
	log.Debugf("Templates have been compiled, count=%d", len(r.templates))
}
555932
func (r *Render) Render(w io.Writer, e Engine, data interface{}) error {
	err := e.Render(w, data)
	if hw, ok := w.(http.ResponseWriter); err != nil && !r.opt.DisableHTTPErrorRendering && ok {
		http.Error(hw, err.Error(), http.StatusInternalServerError)
	}
	return err
}
267100
func (ctx *Context) Render(file string, data ...map[string]interface{}) {
	if ctx.templateLoader == "" {
		panic(fmt.Errorf("Template loader has not been set"))
	}
	var renderData map[string]interface{}
	if len(data) == 0 {
		renderData = make(map[string]interface{})
	} else {
		renderData = data[0]
	}
	renderData["xsrf_token"] = ctx.xsrfToken()
	content, err := ctx.App.View.Render(ctx.templateLoader, file, renderData)
	if err != nil {
		panic(err)
	}
	ctx.Send(content)
}
669367
func (view *View) RenderFromString(loaderName string, tplSrc string, data map[string]interface{}) (string, error) {
	var buf bytes.Buffer
	// If loaderName is not indicated, use the default template library of Go, no syntax like
	// `extends` or `include` will be supported.
	if loaderName == "" {
		tmpl := template.New("error")
		tmpl.Parse(tplSrc)
		e := tmpl.Execute(&buf, data)
		return buf.String(), e
	}
	loader, ok := view.templateLoader[loaderName]
	if !ok {
		panic(Errorf("Template loader not fount: %s", loaderName))
	}
	e := loader.Render(&buf, tplSrc, data)
	if e != nil {
		return "", e
	}
	return buf.String(), nil
}
320053
func (_ *LoadBalancer) RenderALI(t *aliup.ALIAPITarget, a, e, changes *LoadBalancer) error {
	if a == nil {
		glog.V(2).Infof("Creating LoadBalancer with Name:%q", fi.StringValue(e.Name))

		createLoadBalancerArgs := &slb.CreateLoadBalancerArgs{
			RegionId:         common.Region(t.Cloud.Region()),
			LoadBalancerName: fi.StringValue(e.Name),
			AddressType:      slb.AddressType(fi.StringValue(e.AddressType)),
		}
		response, err := t.Cloud.SlbClient().CreateLoadBalancer(createLoadBalancerArgs)
		if err != nil {
			return fmt.Errorf("error creating loadbalancer: %v", err)
		}
		e.LoadbalancerId = fi.String(response.LoadBalancerId)
		e.LoadBalancerAddress = fi.String(response.Address)
	}

	if changes != nil && changes.Tags != nil {
		tagItems := e.jsonMarshalTags(e.Tags)
		addTagsArgs := &slb.AddTagsArgs{
			RegionId:       common.Region(t.Cloud.Region()),
			LoadBalancerID: fi.StringValue(e.LoadbalancerId),
			Tags:           string(tagItems),
		}
		err := t.Cloud.SlbClient().AddTags(addTagsArgs)
		if err != nil {
			return fmt.Errorf("error adding Tags to Loadbalancer: %v", err)
		}
	}

	if a != nil && (len(a.Tags) > 0) {
		glog.V(2).Infof("Modifying LoadBalancer with Name:%q, update LoadBalancer tags", fi.StringValue(e.Name))

		tagsToDelete := e.getLoadBalancerTagsToDelete(a.Tags)
		if len(tagsToDelete) > 0 {
			tagItems := e.jsonMarshalTags(tagsToDelete)
			removeTagsArgs := &slb.RemoveTagsArgs{
				RegionId:       common.Beijing,
				LoadBalancerID: fi.StringValue(a.LoadbalancerId),
				Tags:           string(tagItems),
			}
			if err := t.Cloud.SlbClient().RemoveTags(removeTagsArgs); err != nil {
				return fmt.Errorf("error removing Tags from LoadBalancer: %v", err)
			}
		}
	}

	return nil
}
514200
func (r *RenderTemplateResult) renderError(err error, req *Request, resp *Response) {
	compileError, found := err.(*Error)
	if !found {
		var templateContent []string
		templateName, line, description := ParseTemplateError(err)
		if templateName == "" {
			templateLog.Info("Cannot determine template name to render error", "error", err)
			templateName = r.Template.Name()
			templateContent = r.Template.Content()

		} else {
			lang, _ := r.ViewArgs[CurrentLocaleViewArg].(string)
			if tmpl, err := MainTemplateLoader.TemplateLang(templateName, lang); err == nil {
				templateContent = tmpl.Content()
			} else {
				templateLog.Info("Unable to retreive template ", "error", err)
			}
		}
		compileError = &Error{
			Title:       "Template Execution Error",
			Path:        templateName,
			Description: description,
			Line:        line,
			SourceLines: templateContent,
		}
	}
	resp.Status = 500
	resultsLog.Errorf("render: Template Execution Error (in %s): %s", compileError.Path, compileError.Description)
	ErrorResult{r.ViewArgs, compileError}.Apply(req, resp)
}
207626
func (c Context) Mul(z, x, y *Big) *Big {
	if z.invalidContext(c) {
		return z
	}
	return c.round(c.mul(z, x, y))
}
285007
func (renderer *HTMLTemplateRenderer) Render(template string, model Model) error {
	templates, err := renderer.provider.Provide()
	if err != nil {
		renderer.errorf(template, err)
		return err
	}
	setContentType(renderer.writer, ContentHTML)
	err = templates.ExecuteTemplate(renderer.writer, template, model)
	if err != nil {
		renderer.errorf(template, err)
		return err
	}
	return nil
}
867128
func Render(v string, ctx *Context) (string, error) {
	return (&I{Value: v}).Render(ctx)
}
1129630
func (_ *LoadBalancerListener) RenderALI(t *aliup.ALIAPITarget, a, e, changes *LoadBalancerListener) error {

	loadBalancerId := fi.StringValue(e.LoadBalancer.LoadbalancerId)
	listenertPort := fi.IntValue(e.ListenerPort)
	if a == nil {
		glog.V(2).Infof("Creating LoadBalancerListener with ListenerPort: %q", *e.ListenerPort)

		createLoadBalancerTCPListenerArgs := &slb.CreateLoadBalancerTCPListenerArgs{
			LoadBalancerId:    loadBalancerId,
			ListenerPort:      listenertPort,
			BackendServerPort: fi.IntValue(e.BackendServerPort),
			Bandwidth:         fi.IntValue(e.Bandwidth),
		}
		err := t.Cloud.SlbClient().CreateLoadBalancerTCPListener(createLoadBalancerTCPListenerArgs)
		if err != nil {
			return fmt.Errorf("error creating LoadBalancerlistener: %v", err)
		}
	}

	if fi.StringValue(e.ListenerStatus) == ListenerRunningStatus {
		glog.V(2).Infof("Starting  LoadBalancerListener with ListenerPort: %q", *e.ListenerPort)

		err := t.Cloud.SlbClient().StartLoadBalancerListener(loadBalancerId, listenertPort)
		if err != nil {
			return fmt.Errorf("error starting LoadBalancerListener: %v", err)
		}
	} else {
		glog.V(2).Infof("Stopping  LoadBalancerListener with ListenerPort: %q", *e.ListenerPort)

		err := t.Cloud.SlbClient().StopLoadBalancerListener(loadBalancerId, listenertPort)
		if err != nil {
			return fmt.Errorf("error stopping LoadBalancerListener: %v", err)
		}
	}

	glog.V(2).Infof("Waiting LoadBalancerListener with ListenerPort: %q", *e.ListenerPort)

	_, err := t.Cloud.SlbClient().WaitForListener(loadBalancerId, listenertPort, slb.TCP)
	if err != nil {
		return fmt.Errorf("error waitting LoadBalancerListener: %v", err)
	}

	return nil
}
954414
func (c *Cell) Render(style *renderStyle) (buffer string) {
	// if no alignment is set, import the table's default
	if c.alignment == nil {
		c.alignment = &style.Alignment
	}

	// left padding
	buffer += strings.Repeat(" ", style.PaddingLeft)

	// append the main value and handle alignment
	buffer += c.alignCell(style)

	// right padding
	buffer += strings.Repeat(" ", style.PaddingRight)

	// this handles escaping for, eg, Markdown, where we don't care about the
	// alignment quite as much
	if style.replaceContent != nil {
		buffer = style.replaceContent(buffer)
	}

	return buffer
}
617283
func (c *Context) Render(name string, data interface{}) error {
	return c.weavebox.templateEngine.Render(c.Response(), name, data)
}