<commit_before>package view

import (
	"bytes"
	"fmt"
	"net/http"
)

// Simple reads and responses data directly.
type simple struct {
	header http.Header
}

func (view simple) Render(data interface{}) (output []byte, err error) {
	var buf bytes.Buffer
	if _, err = buf.WriteString(fmt.Sprintf("%s", data)); err != nil {
		return
	}
	return buf.Bytes(), nil
}

func (view simple) Header() http.Header {
	return view.header
}

func Simple(contentType, charSet string) simple {
	if contentType == "" {
		contentType = ContentTypePlain
	}
	if charSet == "" {
		charSet = CharSetUTF8
	}
	header := make(http.Header)
	header.Set("Content-Type",
		fmt.Sprintf("%s; charset=%s", contentType, charSet))
	return simple{header}
}<commit_msg>Simple view should not render  data<commit_after>package view

import (
	"bytes"
	"fmt"
	"net/http"
)

// Simple reads and responses data directly.
type simple struct {
	header http.Header
}

func (view simple) Render(data interface{}) (output []byte, err error) {
	if data == nil {
		return nil, nil
	}
	var buf bytes.Buffer
	if _, err = buf.WriteString(fmt.Sprintf("%s", data)); err != nil {
		return
	}
	return buf.Bytes(), nil
}

func (view simple) Header() http.Header {
	return view.header
}

func Simple(contentType, charSet string) simple {
	if contentType == "" {
		contentType = ContentTypePlain
	}
	if charSet == "" {
		charSet = CharSetUTF8
	}
	header := make(http.Header)
	header.Set("Content-Type",
		fmt.Sprintf("%s; charset=%s", contentType, charSet))
	return simple{header}
}
{'fraction_non_alphanumeric': 0.14116874589625739, 'fraction_numerical': 0.0013131976362442547, 'mean_word_length': 4.148648648648648, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3461374', 'n_tokens_mistral': 524, 'n_tokens_neox': 513, 'n_words': 147}