<commit_before>package stats

import (
	"errors"
	"math"
	"math/rand"
	"sort"
	"time"
)

// Min finds the lowest number in a slice
func Min(input []float64) (min float64, err error) {

	// Get the initial value or return an error
	if len(input) > 0 {
		min = input[0]
	} else {
		return 0, errors.New("Input must not be empty")
	}

	// Iterate until done checking for a lower value
	for i := 1; i < len(input); i++ {
		if input[i] < min {
			min = input[i]
		}
	}
	return min, nil
}

// Max finds the highest number in a slice
func Max(input []float64) (max float64, err error) {

	// Get the initial value
	if len(input) > 0 {
		max = input[0]
	} else {
		return 0, errors.New("Input must not be empty")
	}

	// Loop and replace higher values
	for i := 1; i < len(input); i++ {
		if input[i] > max {
			max = input[i]
		}
	}

	return max, nil
}

// Sum adds all the numbers of a slice together
func Sum(input []float64) (sum float64, err error) {

	// Add em up
	for _, n := range input {
		sum += float64(n)
	}

	return sum, nil<commit_msg>Remove unnecassary typecasting in sum func<commit_after>package stats

import (
	"errors"
	"math"
	"math/rand"
	"sort"
	"time"
)

// Min finds the lowest number in a slice
func Min(input []float64) (min float64, err error) {

	// Get the initial value or return an error
	if len(input) > 0 {
		min = input[0]
	} else {
		return 0, errors.New("Input must not be empty")
	}

	// Iterate until done checking for a lower value
	for i := 1; i < len(input); i++ {
		if input[i] < min {
			min = input[i]
		}
	}
	return min, nil
}

// Max finds the highest number in a slice
func Max(input []float64) (max float64, err error) {

	// Get the initial value
	if len(input) > 0 {
		max = input[0]
	} else {
		return 0, errors.New("Input must not be empty")
	}

	// Loop and replace higher values
	for i := 1; i < len(input); i++ {
		if input[i] > max {
			max = input[i]
		}
	}

	return max, nil
}

// Sum adds all the numbers of a slice together
func Sum(input []float64) (sum float64, err error) {

	// Add em up
	for _, n := range input {
		sum += n
	}

	return sum, nil
{'fraction_non_alphanumeric': 0.13212927756653992, 'fraction_numerical': 0.019961977186311788, 'mean_word_length': 2.841240875912409, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '579543', 'n_tokens_mistral': 835, 'n_tokens_neox': 765, 'n_words': 294}