<commit_before>package minfraud

// DeliverySpeed is a helper type for the shipping delivery speed enum
// field as part of the MinFraud Request Shipping type.
type DeliverySpeed int

const (
	// DeliverySpeedUnknown is for when the delivery speed is not known
	DeliverySpeedUnknown DeliverySpeed = iota

	// DeliverySpeedSameDay is for same day deliveries.
	DeliverySpeedSameDay

	// DeliverySpeedOvernight is for overnight deliveries.
	DeliverySpeedOvernight

	// DeliverySpeedExpedited is for expedited deliveries.
	DeliverySpeedExpedited

	// DeliverySpeeStandard is for standard deliveries.
	DeliverySpeedStandard
)

// MarshalJSON implements the json.Marshaler interface.
func (d DeliverySpeed) MarshalJSON() ([]byte, error) {
	switch d {
	case DeliverySpeedSameDay:
		return []byte(`"same_day"`), nil
	case DeliverySpeedOvernight:
		return []byte(`"overnight"`), nil
	case DeliverySpeedExpedited:
		return []byte(`"expedited"`), nil
	case DeliverySpeedStandard:
		return []byte(`"standard"`), nil
	default:
		return []byte(`"unknown_delivery_speed"`), nil
	}
}

// UnmarshalJSON implements the json.Unmarshaler interface.
func (d *DeliverySpeed) UnmarshalJSON(data []byte) error {
	if len(data) < 3 {
		*d = DeliverySpeedUnknown
	} else {
		switch string(data[1 : len(data)-1]) {
		case "same_day":
			*d = DeliverySpeedSameDay
		case "overnight":
			*d = DeliverySpeedOvernight
		case "expedited":
			*d = DeliverySpeedExpedited
		case "standard":
			*d = DeliverySpeedStandard
		default:
			*d = DeliverySpeedUnknown
		}
	}
	return nil
}
<commit_msg>fix typo in comment<commit_after>package minfraud

// DeliverySpeed is a helper type for the shipping delivery speed enum
// field as part of the MinFraud Request Shipping type.
type DeliverySpeed int

const (
	// DeliverySpeedUnknown is for when the delivery speed is not known
	DeliverySpeedUnknown DeliverySpeed = iota

	// DeliverySpeedSameDay is for same day deliveries.
	DeliverySpeedSameDay

	// DeliverySpeedOvernight is for overnight deliveries.
	DeliverySpeedOvernight

	// DeliverySpeedExpedited is for expedited deliveries.
	DeliverySpeedExpedited

	// DeliverySpeedStandard is for standard deliveries.
	DeliverySpeedStandard
)

// MarshalJSON implements the json.Marshaler interface.
func (d DeliverySpeed) MarshalJSON() ([]byte, error) {
	switch d {
	case DeliverySpeedSameDay:
		return []byte(`"same_day"`), nil
	case DeliverySpeedOvernight:
		return []byte(`"overnight"`), nil
	case DeliverySpeedExpedited:
		return []byte(`"expedited"`), nil
	case DeliverySpeedStandard:
		return []byte(`"standard"`), nil
	default:
		return []byte(`"unknown_delivery_speed"`), nil
	}
}

// UnmarshalJSON implements the json.Unmarshaler interface.
func (d *DeliverySpeed) UnmarshalJSON(data []byte) error {
	if len(data) < 3 {
		*d = DeliverySpeedUnknown
	} else {
		switch string(data[1 : len(data)-1]) {
		case "same_day":
			*d = DeliverySpeedSameDay
		case "overnight":
			*d = DeliverySpeedOvernight
		case "expedited":
			*d = DeliverySpeedExpedited
		case "standard":
			*d = DeliverySpeedStandard
		default:
			*d = DeliverySpeedUnknown
		}
	}
	return nil
}

{'fraction_non_alphanumeric': 0.09408, 'fraction_numerical': 0.00192, 'mean_word_length': 4.704379562043796, 'pattern_counts': {'":': 8, '<': 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': '2102901', 'n_tokens_mistral': 1038, 'n_tokens_neox': 911, 'n_words': 287}