<commit_before>package utils

import (
	"fmt"
	"net/http"
	"os"
	"reflect"
	"strconv"
)

func HandleErr(message string, err error, w http.ResponseWriter) {
	if err != nil {
		println(err.Error())
		fmt.Printf(message+"%v\n", err.Error())
		if w != nil {
			http.Error(w, fmt.Sprintf(message+"%v\n", err.Error()), http.StatusMethodNotAllowed)
		} else {
			os.Exit(1)
		}
	}
}

func ArrayInterfaceToString(array []interface{}) []string {
	s := reflect.ValueOf(array)

	result := make([]string, s.Len())
	for i, v := range array {
		switch v.(type) {
		case int:
			result[i] = strconv.Itoa(v.(int))
		case int64:
			result[i] = strconv.Itoa(int(v.(int64)))
		case float64:
			result[i] = strconv.Itoa(int(v.(float64)))
		case string:
			result[i] = v.(string)
		}

	}
	return result
}<commit_msg>utils: fix whitespace, print error to log<commit_after>package utils

import (
    "fmt"
    "log"
    "net/http"
    "os"
    "reflect"
    "strconv"
)

func HandleErr(message string, err error, w http.ResponseWriter) {
    if err != nil {
        log.Println(err.Error())
        if w != nil {
            http.Error(w, fmt.Sprintf(message+"%v\n", err.Error()), http.StatusMethodNotAllowed)
        } else {
            os.Exit(1)
        }
    }
}

func ArrayInterfaceToString(array []interface{}) []string {
    s := reflect.ValueOf(array)
    result := make([]string, s.Len())
    for i, v := range array {
        switch v.(type) {
        case int:
            result[i] = strconv.Itoa(v.(int))
        case int64:
            result[i] = strconv.Itoa(int(v.(int64)))
        case float64:
            result[i] = strconv.Itoa(int(v.(float64)))
        case string:
            result[i] = v.(string)
        }
    }
    return result
}
{'fraction_non_alphanumeric': 0.16513233601841196, 'fraction_numerical': 0.010356731875719217, 'mean_word_length': 2.5635245901639343, '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': '7170542', 'n_tokens_mistral': 660, 'n_tokens_neox': 630, 'n_words': 133}