<commit_before>package defect

import (
	"reflect"
	"runtime"
	"strconv"
	"testing"
)

// Similar to errors.New(), but can be a const
type Error string

var _ error = Error("")

func (e Error) Error() string { return string(e) }

// Asserts that obtained and expected are equal.  If they are not, sets the test as an error,
// prints the optional message, followed by the values of obtained and expected.
func Equal(t *testing.T, obtained, expected interface{}, message ...interface{}) {
	if obtained != expected {
		t.Error(append(message, []interface{}{
			"\n",
			lineAndFile(2),
			"obtained:", obtained, "\n",
			"expected:", expected, "\n"}...)...)
	}
}

// Asserts that obtained and expected are equal using reflect.DeepEqual.  If they are not,
// sets the test as an error, prints the optional message, followed by the values of obtained
// and expected.
func DeepEqual(t *testing.T, obtained, expected interface{}, message ...interface{}) {
	if !reflect.DeepEqual(obtained, expected) {
		t.Error(append(message, []interface{}{
			"\n",
			"obtained:", obtained, "\n",
			"expected:", expected, "\n"}...)...)
	}
}

func lineAndFile(skip int) string {
	if _, file, line, ok := runtime.Caller(skip); ok {
		return file + ":" + strconv.Itoa(line) + "\n"
	}
	return ""
}
<commit_msg>Only display the file name<commit_after>package defect

import (
	"path/filepath"
	"reflect"
	"runtime"
	"strconv"
	"testing"
)

// Similar to errors.New(), but can be a const
type Error string

var _ error = Error("")

func (e Error) Error() string { return string(e) }

// Asserts that obtained and expected are equal.  If they are not, sets the test as an error,
// prints the optional message, followed by the values of obtained and expected.
func Equal(t *testing.T, obtained, expected interface{}, message ...interface{}) {
	if obtained != expected {
		t.Error(append(message, []interface{}{
			"\n",
			lineAndFile(2),
			"obtained:", obtained, "\n",
			"expected:", expected, "\n"}...)...)
	}
}

// Asserts that obtained and expected are equal using reflect.DeepEqual.  If they are not,
// sets the test as an error, prints the optional message, followed by the values of obtained
// and expected.
func DeepEqual(t *testing.T, obtained, expected interface{}, message ...interface{}) {
	if !reflect.DeepEqual(obtained, expected) {
		t.Error(append(message, []interface{}{
			"\n",
			lineAndFile(2),
			"obtained:", obtained, "\n",
			"expected:", expected, "\n"}...)...)
	}
}

func lineAndFile(skip int) string {
	if _, file, line, ok := runtime.Caller(skip); ok {
		return filepath.Base(file) + ":" + strconv.Itoa(line) + "\n"
	}
	return ""
}

{'fraction_non_alphanumeric': 0.15946969696969698, 'fraction_numerical': 0.0011363636363636363, 'mean_word_length': 3.7245080500894456, 'pattern_counts': {'":': 2, '<': 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': '2420123', 'n_tokens_mistral': 861, 'n_tokens_neox': 820, 'n_words': 294}