// Render renders the Statement to the provided writer.
973875
func (s *Statement) Render(writer io.Writer) error {
	return s.RenderWithFile(writer, NewFile(""))
}
757587
func (OCIRenderer) Render(cfg cloudinit.CloudConfig, os jujuos.OSType) ([]byte, error) {
	var renderedUdata []byte
	var err error
	switch os {
	case jujuos.Ubuntu, jujuos.CentOS:
		renderedUdata, err = renderers.RenderYAML(cfg)
	default:
		return nil, errors.Errorf("Cannot encode userdata for OS: %s", os.String())
	}

	if err != nil {
		return nil, err
	}
	ret := b64.StdEncoding.EncodeToString(renderedUdata)
	return []byte(ret), nil
}
1020526
func Render(templateFile, outputFile string, outputPerm os.FileMode, x interface{}) {
	tpl := template.Must(template.ParseFiles(templateFile))
	render(tpl, outputFile, outputPerm, x)
}
1059022
func (view *View) Render(loaderName string, filePath string, data map[string]interface{}) (string, error) {
	loader, ok := view.templateLoader[loaderName]
	if !ok {
		panic(errors.New("Template loader not found: " + loaderName))
	}
	var buf bytes.Buffer
	err := loader.Render(&buf, filePath, data)
	if err != nil {
		return "", err
	}
	return buf.String(), nil
}
690736
func Render(c Compo) {
	WhenDebug(func() {
		Logf("rendering %T")
	})

	if err := render(c); err != nil {
		Log(err)
	}
}
191508
func (p *WebPage) Render(filename, format string, quality int) error {
	req := map[string]interface{}{"ref": p.ref.id, "filename": filename, "format": format, "quality": quality}
	return p.ref.process.doJSON("POST", "/webpage/Render", req, nil)
}
862502
func Render(c context.Context, name string, args Args) ([]byte, error) {
	if b, _ := c.Value(&contextKey).(*boundBundle); b != nil {
		return b.Render(c, b.Extra, name, args)
	}
	return nil, errNoBundle
}
767999
func Render(w io.Writer, tpl string, data interface{}) error {
	templateFuncs := template.FuncMap{
		"last": func(x int, a interface{}) bool {
			return x == reflect.ValueOf(a).Len()-1
		},
	}
	tplParsed := template.Must(template.New("render").Funcs(templateFuncs).Parse(tpl))
	return tplParsed.Execute(w, data)
}
1173796
func (t *Table) Render() {
	if t.borders.Top {
		t.printLine(true)
	}
	t.printHeading()
	if t.autoMergeCells {
		t.printRowsMergeCells()
	} else {
		t.printRows()
	}
	if !t.rowLine && t.borders.Bottom {
		t.printLine(true)
	}
	t.printFooter()

	if t.caption {
		t.printCaption()
	}
}
710321
func Render(node Node) string {
	buf := bytes.NewBuffer(nil)
	node.write(buf, 0, 0)
	return buf.String()
}
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
}
138285
func Render(colorCode int, fontSize int, content string) string {
	return "\033[" + strconv.Itoa(fontSize) + ";" + strconv.Itoa(colorCode) + "m" + content + reset
}
396873
func (r *Renderer) Render(str []byte) []byte {
	bl, sl, el := len(r.begin), len(str), len(r.end)
	data := make([]byte, bl+sl+el)
	copy(data, r.begin)
	copy(data[bl:], str)
	copy(data[bl+sl:], r.end)
	return data
}
281025
func (t *Tabulate) Render(format ...interface{}) string {
	var lines []string

	// If headers are set use them, otherwise pop the first row
	if len(t.Headers) < 1 && len(t.Data) > 1 {
		t.Headers, t.Data = t.Data[0].Elements, t.Data[1:]
	}

	// Use the format that was passed as parameter, otherwise
	// use the format defined in the struct
	if len(format) > 0 {
		t.TableFormat = TableFormats[format[0].(string)]
	}

	// If Wrap Strings is set to True,then break up the string to multiple cells
	if t.WrapStrings {
		t.Data = t.wrapCellData()
	}

	// Check if Data is present
	if len(t.Data) < 1 {
		return ""
	}

	if len(t.Headers) < len(t.Data[0].Elements) {
		diff := len(t.Data[0].Elements) - len(t.Headers)
		padded_header := make([]string, diff)
		for _, e := range t.Headers {
			padded_header = append(padded_header, e)
		}
		t.Headers = padded_header
	}

	// Get Column widths for all columns
	cols := t.getWidths(t.Headers, t.Data)

	padded_widths := make([]int, len(cols))
	for i, _ := range padded_widths {
		padded_widths[i] = cols[i] + MIN_PADDING*t.TableFormat.Padding
	}

	// Calculate total width of the table
	totalWidth := len(t.TableFormat.DataRow.sep) * (len(cols) - 1) // Include all but the final separator
	for _, w := range padded_widths {
		totalWidth += w
	}

	// Start appending lines
	if len(t.Title) > 0 {
		if !inSlice("aboveTitle", t.HideLines) {
			lines = append(lines, t.buildLine(padded_widths, cols, t.TableFormat.LineTop))
		}
		savedAlign := t.Align
		if len(t.TitleAlign) > 0 {
			t.SetAlign(t.TitleAlign) // Temporary replace alignment with the title alignment
		}
		lines = append(lines, t.buildRow([]string{t.Title}, []int{totalWidth}, nil, t.TableFormat.TitleRow))
		t.SetAlign(savedAlign)
	}

	// Append top line if not hidden
	if !inSlice("top", t.HideLines) {
		lines = append(lines, t.buildLine(padded_widths, cols, t.TableFormat.LineTop))
	}

	// Add Header
	lines = append(lines, t.buildRow(t.padRow(t.Headers, t.TableFormat.Padding), padded_widths, cols, t.TableFormat.HeaderRow))

	// Add Line Below Header if not hidden
	if !inSlice("belowheader", t.HideLines) {
		lines = append(lines, t.buildLine(padded_widths, cols, t.TableFormat.LineBelowHeader))
	}

	// Add Data Rows
	for index, element := range t.Data {
		lines = append(lines, t.buildRow(t.padRow(element.Elements, t.TableFormat.Padding), padded_widths, cols, t.TableFormat.DataRow))
		if index < len(t.Data)-1 {
			if element.Continuos != true && !inSlice("betweenLine", t.HideLines) {
				lines = append(lines, t.buildLine(padded_widths, cols, t.TableFormat.LineBetweenRows))
			}
		}
	}

	if !inSlice("bottomLine", t.HideLines) {
		lines = append(lines, t.buildLine(padded_widths, cols, t.TableFormat.LineBottom))
	}

	// Join lines
	var buffer bytes.Buffer
	for _, line := range lines {
		buffer.WriteString(line + "\n")
	}

	return buffer.String()
}
1242829
func (f *File) Render(spec *Specifier) (string, error) {
	ret, err := f.Template[spec.TemplateName].Render(spec.Params)
	if err != nil {
		err = fmt.Errorf("rendering %q: %s", spec.TemplateName, err)
	}
	return ret, err
}
612891
func (j JE) Render() map[string]string {

	if j.error == "" {
		if j.message == "" {
			return map[string]string{"code": fmt.Sprintf("%d", j.Code)}
		} else {
			return map[string]string{"code": fmt.Sprintf("%d", j.Code), "message": j.message}
		}
	} else {
		if j.message == "" {
			return map[string]string{"code": fmt.Sprintf("%d", j.Code), "error": j.error}
		} else {
			return map[string]string{"code": fmt.Sprintf("%d", j.Code), "error": j.error, "message": j.message}
		}
	}
}
669968
func (renderer *Renderer) Render(response *plugins.Response, files []string) (err error) {
	for _, filename := range files {
		file := &plugins.File{Name: filename}
		switch filename {
		case "client.go":
			file.Data, err = renderer.RenderClient()
		case "types.go":
			file.Data, err = renderer.RenderTypes()
		case "provider.go":
			file.Data, err = renderer.RenderProvider()
		case "server.go":
			file.Data, err = renderer.RenderServer()
		case "constants.go":
			file.Data, err = renderer.RenderConstants()
		default:
			file.Data = nil
		}
		if err != nil {
			response.Errors = append(response.Errors, fmt.Sprintf("ERROR %v", err))
		}
		// run generated Go files through imports pkg
		if filepath.Ext(file.Name) == ".go" {
			file.Data, err = imports.Process(file.Name, file.Data, nil)
		}
		response.Files = append(response.Files, file)
	}
	return
}