<commit_before>package atlas

import (
	"errors"
)

const (
	allTypes = []string{
		"dns",
		"ntp",
		"ping",
		"sslcert",
		"traceroute",
		"wifi",
	}
)

var ErrInvalidMeasurementType = errors.New("invalid measurement type")

// checkType verify that the type is valid
func checkType(d Definition) (valid bool) {
	valid = false
	for _, t := range allTypes {
		if d.Type == t {
			valid = true
			break
		}
	}
	return
}

// DNS creates a measurement
func DNS(d Definition) (m *Measurement, err error) {
	if checkType(d) || d.Type != "dns" {
		err = ErrInvalidMeasurementType
		return
	}
	return
}

// NTP creates a measurement
func NTP(d Definition) (m *Measurement, err error) {
	return
}

// Ping creates a measurement
func Ping(d Definition) (m *Measurement, err error) {
	return
}

// SSLCert creates a measurement
func SSLCert(d Definition) (m *Measurement, err error) {
	return
}

// Traceroute creates a measurement
func Traceroute(d Definition) (m *Measurement, err error) {
	return
}
<commit_msg>Turn that into a var.<commit_after>package atlas

import (
	"errors"
)

var (
	allTypes = []string{
		"dns",
		"ntp",
		"ping",
		"sslcert",
		"traceroute",
		"wifi",
	}
)

var ErrInvalidMeasurementType = errors.New("invalid measurement type")

// checkType verify that the type is valid
func checkType(d Definition) (valid bool) {
	valid = false
	for _, t := range allTypes {
		if d.Type == t {
			valid = true
			break
		}
	}
	return
}

// DNS creates a measurement
func DNS(d Definition) (m *Measurement, err error) {
	if checkType(d) || d.Type != "dns" {
		err = ErrInvalidMeasurementType
		return
	}
	return
}

// NTP creates a measurement
func NTP(d Definition) (m *Measurement, err error) {
	return
}

// Ping creates a measurement
func Ping(d Definition) (m *Measurement, err error) {
	return
}

// SSLCert creates a measurement
func SSLCert(d Definition) (m *Measurement, err error) {
	return
}

// Traceroute creates a measurement
func Traceroute(d Definition) (m *Measurement, err error) {
	return
}

{'fraction_non_alphanumeric': 0.1195436507936508, 'fraction_numerical': 0.0, 'mean_word_length': 3.6689814814814814, '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': '604264', 'n_tokens_mistral': 733, 'n_tokens_neox': 700, 'n_words': 224}