<commit_before>// This package is a fork of the golang expvar expvar.Var types.
// Adding extra support for deleting and accessing raw typed values.
package expvar

import (
	"bytes"
	"expvar"
	"fmt"
	"math"
	"sort"
	"strconv"
	"sync"
	"sync/atomic"
)

type IntVar interface {
	IntValue() int64
}

type FloatVar interface {
	FloatValue() float64
}

type StringVar interface {
	StringValue() string
}

// Int is a 64-bit integer variable that satisfies the expvar.Var interface.
type Int struct {
	i int64
}

func (v *Int) String() string {
	return strconv.FormatInt(v.IntValue(), 10)
}

func (v *Int) Add(delta int64) {
	atomic.AddInt64(&v.i, delta)
}

func (v *Int) Set(value int64) {
	atomic.StoreInt64(&v.i, value)
}

func (v *Int) IntValue() int64 {
	return atomic.LoadInt64(&v.i)
}

// IntSum is a 64-bit integer variable that consists of multiple different parts
// and satisfies the expvar.Var interface.
// The value of the var is the sum of all its parts.
// The part names are opaque and are simply used to identfy each part.
type IntSum struct {
	mu    sync.Mutex
	parts map[string]int64
	sum   int64
}

func NewIntSum() *IntSum {
	return &IntSum{
		parts: make(map[string]int64),
	}<commit_msg>Add IntFuncGauge to expvar package<commit_after>// This package is a fork of the golang expvar expvar.Var types.
// Adding extra support for deleting and accessing raw typed values.
package expvar

import (
	"bytes"
	"expvar"
	"fmt"
	"math"
	"sort"
	"strconv"
	"sync"
	"sync/atomic"
)

type IntVar interface {
	IntValue() int64
}

type FloatVar interface {
	FloatValue() float64
}

type StringVar interface {
	StringValue() string
}

// Int is a 64-bit integer variable that satisfies the expvar.Var interface.
type Int struct {
	i int64
}

func (v *Int) String() string {
	return strconv.FormatInt(v.IntValue(), 10)
}

func (v *Int) Add(delta int64) {
	atomic.AddInt64(&v.i, delta)
}

func (v *Int) Set(value int64) {
	atomic.StoreInt64(&v.i, value)
}

func (v *Int) IntValue() int64 {
	return atomic.LoadInt64(&v.i)
}

// IntGauge is a 64-bit integer variable that satisfies the expvar.Var interface.
type IntFuncGauge struct {
	ValueF func() int
}

func (v *IntFuncGauge) String() string {
	return strconv.FormatInt(v.IntValue(), 10)
}

func (v *IntFuncGauge) Add(delta int64) {}
func (v *IntFuncGauge) Set(value int64) {}

func (v *IntFuncGauge) IntValue() int64 {
	return int64(v.ValueF())
}

func NewIntFuncGauge(fn func() int) *IntFuncGauge {
	return &IntFuncGauge{fn}
}

// IntSum is a 64-bit integer variable that consists of multiple different parts
// and satisfies the expvar.Var interface.
// The value of the var is the sum of all its parts.
// The part names are opaque and are simply used to identfy each part.
type IntSum struct {
	mu    sync.Mutex
	parts map[string]int64
	sum   int64
}

func NewIntSum() *IntSum {
	return &IntSum{
		parts: make(map[string]int64),
	}
{'fraction_non_alphanumeric': 0.11103424420615704, 'fraction_numerical': 0.024904877205119337, 'mean_word_length': 3.9351535836177476, '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': '6463175', 'n_tokens_mistral': 1069, 'n_tokens_neox': 1015, 'n_words': 355}