<commit_before>package eff

type EffectivenessSlice []Effectiveness

func All() EffectivenessSlice {
	result := make([]Effectiveness, 4)
	for i, e := 0, EX; e <= EO; i, e = i+1, e+1 {
		result[i] = e
	}
	return result
}

func (es EffectivenessSlice) ForEach(consumer func(Effectiveness)) {
	for _, e := range es {
		consumer(e)
	}
}<commit_msg>Updated 'EffectivenessSlice' to follow that of PokemonSlice<commit_after>package eff

import (
	"sort"
)

type EffectivenessIterable interface {
	ForEach(consumer func(Effectiveness))
	Filter(predicate func(Effectiveness) bool) EffectivenessIterable
	Sort(less func(Effectiveness, Effectiveness) bool) EffectivenessIterable
}

type EffectivenessSlice []Effectiveness

func (es EffectivenessSlice) ForEach(consumer func(Effectiveness)) {
	for _, e := range es {
		consumer(e)
	}
}

func (es EffectivenessSlice) Filter(predicate func(Effectiveness) bool) EffectivenessIterable {
	result := make(EffectivenessSlice, 0)
	for _, e := range es {
		if predicate(e) {
			result = append(result, e)
		}
	}
	return result
}

func (es EffectivenessSlice) Sort(less func(Effectiveness, Effectiveness) bool) EffectivenessIterable {
	result := make(EffectivenessSlice, len(es))
	copy(result, es)
	sort.Stable(sortableEffectivenessSlice{result, less})
	return result
}

func All() EffectivenessIterable {
	return virtualEffectivenessSlice(0)
}

type virtualEffectivenessSlice int

func (es virtualEffectivenessSlice) ForEach(consumer func(Effectiveness)) {
	for e := EX; e <= EO; e++ {
		consumer(e)
	}
}

func (es virtualEffectivenessSlice) Filter(predicate func(Effectiveness) bool) EffectivenessIterable {
	result := make(EffectivenessSlice, 0)
	for e := EX; e <= EO; e++ {
		if predicate(e) {
			result = append(result, e)
		}
	}
	return result
}

func (es virtualEffectivenessSlice) Sort(less func(Effectiveness, Effectiveness) bool) EffectivenessIterable {
	result := make(EffectivenessSlice, 4)
	for i, e := 0, EX; e <= EO; i, e = i+1, e+1 {
		result[i] = e
	}
	sort.Stable(sortableEffectivenessSlice{result, less})
	return result
}

type sortableEffectivenessSlice struct {
	slice EffectivenessSlice
	less  func(Effectiveness, Effectiveness) bool
}

func (es sortableEffectivenessSlice) Len() int {
	return len(es.slice)
}

func (es sortableEffectivenessSlice) Less(i, j int) bool {
	return es.less(es.slice[i], es.slice[j])
}

func (es sortableEffectivenessSlice) Swap(i, j int) {
	es.slice[i], es.slice[j] = es.slice[j], es.slice[i]
}
{'fraction_non_alphanumeric': 0.11686211079660332, 'fraction_numerical': 0.004448038819247877, 'mean_word_length': 5.4934383202099735, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3652891', 'n_tokens_mistral': 847, 'n_tokens_neox': 816, 'n_words': 218}