<commit_before>type Kahan{T <: FloatingPoint}
	sum::T
	c::T
end

Kahan{T <: FloatingPoint}(::Type{T}) = Kahan{T}(convert(T, 0), convert(T, 0))

import NumericExtensions.add!
function add!{T <: FloatingPoint}(k::Kahan{T}, x::T)
	y = x - k.c
	t = k.sum + y
	k.c = (t - k.sum) - y
	k.sum = t
end

import Base.sum
sum(k::Kahan) = k.sum<commit_msg>mean counter added<commit_after>type Kahan{T <: FloatingPoint}
	sum::T
	c::T
end

Kahan{T <: FloatingPoint}(::Type{T}) = Kahan{T}(convert(T, 0), convert(T, 0))

import NumericExtensions.add!
function add!{T <: FloatingPoint}(k::Kahan{T}, x::T)
	y = x - k.c
	t = k.sum + y
	k.c = (t - k.sum) - y
	k.sum = t
end

import Base.sum
sum(k::Kahan) = k.sum

type MeanCounter{T <: FloatingPoint}
	n::Int64
	mean::Kahan{T}
end

MeanCounter{T <: FloatingPoint}(::Type{T}) = MeanCounter{T}(0, Kahan(T))

function add!{T <: FloatingPoint}{m::MeanCounter{T}, x::T}
	m.n += 1
	add!(m.mean, (x - m.mean) / m.n)
	return m.mean
end

export Kahan, MeanCounter, add!, sum
{'fraction_non_alphanumeric': 0.20422535211267606, 'fraction_numerical': 0.008048289738430584, 'mean_word_length': 4.292553191489362, 'pattern_counts': {'":': 0, '<': 12, '<?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': '3893399', 'n_tokens_mistral': 459, 'n_tokens_neox': 449, 'n_words': 99}