<commit_before>package wsmaterials

import (
	"fmt"
	"github.com/emicklei/go-restful"
	"net/http"
)

type JsonpResponseWriter struct {
	writer   http.ResponseWriter
	callback string
}

func (j *JsonpResponseWriter) Header() http.Header {
	return j.writer.Header()
}

func (j *JsonpResponseWriter) WriteHeader(status int) {
	j.writer.WriteHeader(status)
}

func (j *JsonpResponseWriter) Write(bytes []byte) (int, error) {
	if j.callback != "" {
		bytes = []byte(fmt.Sprintf("%s(%s)", j.callback, bytes))
	}
	return j.writer.Write(bytes)
}

func NewJsonpResponseWriter(httpWriter http.ResponseWriter, callback string) *JsonpResponseWriter {
	jsonpResponseWriter := new(JsonpResponseWriter)
	jsonpResponseWriter.writer = httpWriter
	jsonpResponseWriter.callback = callback
	return jsonpResponseWriter
}

func JsonpFilter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) {
	callback := req.Request.FormValue("callback")
	jsonpResponseWriter := NewJsonpResponseWriter(resp.ResponseWriter, callback)
	resp.ResponseWriter = jsonpResponseWriter
	chain.ProcessFilter(req, resp)
}<commit_msg>Remove some definitions and methods from the public space (lowercase their name)<commit_after>package wsmaterials

import (
	"fmt"
	"github.com/emicklei/go-restful"
	"net/http"
)

type jsonpResponseWriter struct {
	writer   http.ResponseWriter
	callback string
}

func (j *jsonpResponseWriter) Header() http.Header {
	return j.writer.Header()
}

func (j *jsonpResponseWriter) WriteHeader(status int) {
	j.writer.WriteHeader(status)
}

func (j *jsonpResponseWriter) Write(bytes []byte) (int, error) {
	if j.callback != "" {
		bytes = []byte(fmt.Sprintf("%s(%s)", j.callback, bytes))
	}
	return j.writer.Write(bytes)
}

func newJsonpResponseWriter(httpWriter http.ResponseWriter, callback string) *jsonpResponseWriter {
	jsonpResponseWriter := new(jsonpResponseWriter)
	jsonpResponseWriter.writer = httpWriter
	jsonpResponseWriter.callback = callback
	return jsonpResponseWriter
}

func JsonpFilter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) {
	callback := req.Request.FormValue("callback")
	jsonpResponseWriter := newJsonpResponseWriter(resp.ResponseWriter, callback)
	resp.ResponseWriter = jsonpResponseWriter
	chain.ProcessFilter(req, resp)
}
{'fraction_non_alphanumeric': 0.11398509425690487, 'fraction_numerical': 0.0, 'mean_word_length': 6.267515923566879, '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': '6471536', 'n_tokens_mistral': 727, 'n_tokens_neox': 718, 'n_words': 153}