<commit_before>package glue

import (
	"net/http"

	"github.com/tmc/inj"
)

type Context struct {
	*Glue
	inj.Injector
	rw *ResponseWriter
}

func (g *Glue) newContext(w http.ResponseWriter, r *http.Request) *Context {
	ctx := &Context{g,
		inj.New(),
		NewResponseWriter(w)}

	ctx.Register(r)
	// register our ResponseWriter as an http.ResponseWriter or net/http HandlerFunc compatibility
	ctx.RegisterAs(ctx.rw, (*http.ResponseWriter)(nil))
	// register this instance with itself
	ctx.Register(*ctx)
	return ctx
}

func (ctx *Context) handle() {
	for _, h := range append(ctx.handlers, ctx.defaultHandler) {
		_, err := ctx.Call(h)
		if err != nil {
			panic(err)
		}
		if ctx.rw.WroteHeader() {
			break
		}
	}<commit_msg>Rearrange for consistency<commit_after>package glue

import (
	"net/http"

	"github.com/tmc/inj"
)

type Context struct {
	inj.Injector
	*Glue
	rw *ResponseWriter
}

func (g *Glue) newContext(w http.ResponseWriter, r *http.Request) *Context {
	ctx := &Context{inj.New(), g, NewResponseWriter(w)}

	ctx.Register(r)
	// register our ResponseWriter as an http.ResponseWriter or net/http HandlerFunc compatibility
	ctx.RegisterAs(ctx.rw, (*http.ResponseWriter)(nil))
	// register this instance with itself
	ctx.Register(*ctx)
	return ctx
}

func (ctx *Context) handle() {
	for _, h := range append(ctx.handlers, ctx.defaultHandler) {
		_, err := ctx.Call(h)
		if err != nil {
			panic(err)
		}
		if ctx.rw.WroteHeader() {
			break
		}
	}
{'fraction_non_alphanumeric': 0.13717421124828533, 'fraction_numerical': 0.0, 'mean_word_length': 3.9795221843003414, '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': '1392466', 'n_tokens_mistral': 551, 'n_tokens_neox': 515, 'n_words': 128}