<commit_before>package handler

import (
//	"github.com/materials-commons/config"
)

const (
	// Use the default handler
	Default = "Default"

	// Use the Override handler
	Override = "Override"

	// Use the environment handler
	Environment = "Environment"

	// Use the ini handler
	Ini = "Ini"
)<commit_msg>Create handler that acts like github.com/spf13/viper.<commit_after>package handler

import (
	"github.com/materials-commons/config"
)

const (
	// Use the default handler
	Default = "Default"

	// Use the Override handler
	Override = "Override"

	// Use the environment handler
	Environment = "Environment"

	// Use the ini handler
	Ini = "Ini"
)

// Viper implements github.com/spf13/viper
func Viper(loader config.Loader) config.Handler {
	return LowercaseKey(
		Prioritized(
			NameHandler(Default, Map()),
			NameHandler(Override, Map()),
			NameHandler(Ini, Loader(loader))))
}

// ViperCaseSensitive implements github.com/spf13/viper except that keys
// are case sensitive.
func ViperCaseSensitive(loader config.Loader) config.Handler {
	return Prioritized(
		NameHandler(Default, Map()),
		NameHandler(Override, Map()),
		NameHandler(Ini, Loader(loader)))
}

// ViperEx implements github.com/spf13/viper with the addition of environment
// variables checked before checking for values in the ini file(s).
func ViperEx(loader config.Loader) config.Handler {
	return LowercaseKey(
		Prioritized(
			NameHandler(Default, Map()),
			NameHandler(Override, Map()),
			NameHandler(Environment, Env()),
			NameHandler(Ini, Loader(loader))))
}

// ViperExCaseSensitive implements ViperEx except that keys are case sensitive.
func ViperExCaseSensitive(loader config.Loader) config.Handler {
	return Prioritized(
		NameHandler(Default, Map()),
		NameHandler(Override, Map()),
		NameHandler(Environment, Env()),
		NameHandler(Ini, Loader(loader)))
}
{'fraction_non_alphanumeric': 0.11555075593952484, 'fraction_numerical': 0.004319654427645789, 'mean_word_length': 4.615151515151515, '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': '5853116', 'n_tokens_mistral': 603, 'n_tokens_neox': 557, 'n_words': 156}