<commit_before>package qor

import (
	"fmt"

	"os"
	"runtime"
	"runtime/debug"
	"strings"
)

func filenameWithLineNum() string {
	var total = 10
	var results []string
	for i := 2; i < 15; i++ {
		if _, file, line, ok := runtime.Caller(i); ok {
			total--
			results = append(results[:0],
				append(
					[]string{fmt.Sprintf("%v:%v", strings.TrimPrefix(file, os.Getenv("GOPATH")+"src/"), line)},
					results[0:len(results)]...)...)

			if total == 0 {
				return strings.Join(results, "\n")
			}
		}
	}
	return ""
}

func ExitWithMsg(str string, value ...interface{}) {
	debug.PrintStack()
	fmt.Printf("\n"+filenameWithLineNum()+"\n"+str+"\n", value...)
	os.Exit(1)
}<commit_msg>ExitWithMsg: print error msg before stacks<commit_after>package qor

import (
	"fmt"

	"os"
	"runtime"
	"runtime/debug"
	"strings"
)

func filenameWithLineNum() string {
	var total = 10
	var results []string
	for i := 2; i < 15; i++ {
		if _, file, line, ok := runtime.Caller(i); ok {
			total--
			results = append(results[:0],
				append(
					[]string{fmt.Sprintf("%v:%v", strings.TrimPrefix(file, os.Getenv("GOPATH")+"src/"), line)},
					results[0:len(results)]...)...)

			if total == 0 {
				return strings.Join(results, "\n")
			}
		}
	}
	return ""
}

func ExitWithMsg(str string, value ...interface{}) {
	fmt.Printf("\n"+filenameWithLineNum()+"\n"+str+"\n", value...)
	debug.PrintStack()
	os.Exit(1)
}
{'fraction_non_alphanumeric': 0.20776419841840402, 'fraction_numerical': 0.012940330697340043, 'mean_word_length': 3.4615384615384617, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4676679', 'n_tokens_mistral': 586, 'n_tokens_neox': 519, 'n_words': 113}