<commit_before>package main

type HandlerContainer interface {
	Attach(Handler)
	Detach(Handler)
	Bind(*Unit) HandlerContainer
	BindSubject(Subject) HandlerContainer
	BindObject(Object) HandlerContainer
	Unbind() HandlerContainer
	Each(func(Handler))
	Every(func(Handler) bool) bool
	Some(func(Handler) bool) bool
}

type HandlerSet map[Handler]bool

type BoundHandlerSet struct {
	handlers HandlerContainer
	unit     *Unit
	subject  *Unit
	object   *Unit
}

// MakeHandlerSet returns a HandlerSet
func MakeHandlerSet() HandlerSet {
	return make(map[Handler]bool)
}

// Attach adds the Handler if not exists
func (hs HandlerSet) Attach(h Handler) {
	if hs[h] {
		return
	}
	hs[h] = true
	h.OnAttach()
}

// Detach removes the Handler if exists
func (hs HandlerSet) Detach(h Handler) {
	if !hs[h] {
		return
	}
	delete(hs, h)<commit_msg>Change the element type of BoundHandlerSet<commit_after>package main

type HandlerContainer interface {
	Attach(Handler)
	Detach(Handler)
	Bind(*Unit) HandlerContainer
	BindSubject(Subject) HandlerContainer
	BindObject(Object) HandlerContainer
	Unbind() HandlerContainer
	Each(func(Handler))
	Every(func(Handler) bool) bool
	Some(func(Handler) bool) bool
}

type HandlerSet map[Handler]bool

type BoundHandlerSet struct {
	handlers HandlerSet
	unit     *Unit
	subject  *Unit
	object   *Unit
}

// MakeHandlerSet returns a HandlerSet
func MakeHandlerSet() HandlerSet {
	return make(map[Handler]bool)
}

// Attach adds the Handler if not exists
func (hs HandlerSet) Attach(h Handler) {
	if hs[h] {
		return
	}
	hs[h] = true
	h.OnAttach()
}

// Detach removes the Handler if exists
func (hs HandlerSet) Detach(h Handler) {
	if !hs[h] {
		return
	}
	delete(hs, h)
{'fraction_non_alphanumeric': 0.0943952802359882, 'fraction_numerical': 0.0, 'mean_word_length': 4.93006993006993, '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': '4399118', 'n_tokens_mistral': 601, 'n_tokens_neox': 558, 'n_words': 162}