<commit_before>package main

import (
	"log"

	"github.com/netrack/net/l2"
	"github.com/netrack/openflow"
	"github.com/netrack/openflow/ofp.v13"
)

func main() {
	of.HandleFunc(of.TypeHello, func(rw of.ResponseWriter, r *of.Request) {
		log.Println("RECV ofp_hello:", r.Header)
		rw.Header().Type = of.TypeHello
		rw.WriteHeader()

		log.Println("SEND ofp_hello:", rw.Header())
	})

	of.HandleFunc(of.TypePacketIn, func(rw of.ResponseWriter, r *of.Request) {
		var p ofp.PacketIn
		var e l2.EthernetII

		p.ReadFrom(r.Body)
		e.ReadFrom(r.Body)

		log.Println("RECV ofp_packet_in:", r.Header)
		log.Println("RECV ofp_packet_in:", e.HWDst, e.HWSrc)

		instr := ofp.Instructions{ofp.InstructionActions{
			ofp.IT_APPLY_ACTIONS,
			ofp.Actions{ofp.ActionOutput{ofp.P_FLOOD, 0}},
		}}

		fmod := &ofp.FlowMod{
			Command:      ofp.FC_ADD,
			BufferID:     p.BufferID,
			Match:        p.Match,
			Instructions: instr,
		}

		rw.Header().Type = of.TypeFlowMod

		rw.Write(fmod.Bytes())
		rw.WriteHeader()
		log.Println("SEND ofp_of_mod:", rw.Header())
	})

	of.HandleFunc(of.TypeEchoRequest, func(rw of.ResponseWriter, r *of.Request) {
		log.Println("RECV ofp_echo_request:", r.Header)
		rw.Header().Type = of.TypeEchoReply
		rw.WriteHeader()
		log.Println("SEND ofp_echo_reply:", rw.Header())
	})

	log.Println("started listening...")
	of.ListenAndServe()
}
<commit_msg>Fixed examply to comply with new interface.<commit_after>package main

import (
	"log"

	"github.com/netrack/net/l2"
	"github.com/netrack/openflow"
	"github.com/netrack/openflow/ofp.v13"
)

func main() {
	of.HandleFunc(of.TypeHello, func(rw of.ResponseWriter, r *of.Request) {
		log.Println("RECV ofp_hello:", r.Header)
		defer log.Println("SEND ofp_hello")
		rw.WriteHeader(&of.Header{Type: of.TypeHello})
	})

	of.HandleFunc(of.TypePacketIn, func(rw of.ResponseWriter, r *of.Request) {
		var p ofp.PacketIn
		var e l2.EthernetII

		p.ReadFrom(r.Body)
		e.ReadFrom(r.Body)

		log.Println("RECV ofp_packet_in:", r.Header)
		log.Println("RECV ofp_packet_in:", e.HWDst, e.HWSrc)

		instr := ofp.Instructions{ofp.InstructionActions{
			ofp.IT_APPLY_ACTIONS,
			ofp.Actions{ofp.ActionOutput{ofp.P_FLOOD, 0}},
		}}

		fmod := &ofp.FlowMod{
			Command:      ofp.FC_ADD,
			BufferID:     p.BufferID,
			Match:        p.Match,
			Instructions: instr,
		}

		rw.Write(fmod.Bytes())
		rw.WriteHeader(&of.Header{Type: of.TypeFlowMod})
		log.Println("SEND ofp_of_mod")
	})

	of.HandleFunc(of.TypeEchoRequest, func(rw of.ResponseWriter, r *of.Request) {
		log.Println("RECV ofp_echo_request:", r.Header)
		defer log.Println("SEND ofp_echo_reply")
		rw.WriteHeader(&of.Header{Type: of.TypeEchoReply})
	})

	log.Println("started listening...")
	of.ListenAndServe()
}

{'fraction_non_alphanumeric': 0.1582045621780721, 'fraction_numerical': 0.003679175864606328, 'mean_word_length': 4.044526901669759, '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': '5474148', 'n_tokens_mistral': 1208, 'n_tokens_neox': 1113, 'n_words': 166}