<commit_before>package hepmc

import (
	"fmt"
)

type MomentumUnit int
type LengthUnit int

const (
	MEV MomentumUnit = iota // Momentum in MeV (default)
	GEV                     // Momentum in GeV
)

const (
	MM LengthUnit = iota // Length in mm (default)
	CM                   // Length in cm
)

func (mu MomentumUnit) String() string {
	switch mu {
	case MEV:
		return "MEV"
	case GEV:
		return "GEV"
	}
	err := fmt.Errorf("hepmc.units: invalid MomentumUnit value (%d)", int(mu))
	panic(err.Error())
}

func MomentumUnitFromString(s string) (MomentumUnit, error) {
	switch s {
	case "MEV":
		return MEV, nil
	case "GEV":
		return GEV, nil
	}
	err := fmt.Errorf("hepmc.units: invalid MomentumUnit string-value (%s)", s)
	return -1, err
}

func (lu LengthUnit) String() string {
	switch lu {
	case MM:
		return "MM"
	case CM:
		return "CM"
	}
	err := fmt.Errorf("hepmc.units: invalid LengthUnit value (%d)", int(lu))
	panic(err.Error())
}

func LengthUnitFromString(s string) (LengthUnit, error) {
	switch s {
	case "MM":
		return MM, nil
	case "CM":
		return CM, nil
	}
	err := fmt.Errorf("hepmc.units: invalid LengthUnit string-value (%s)", s)
	return -1, err
}

// EOF
<commit_msg>units: add docstrings<commit_after>package hepmc

import (
	"fmt"
)

// MomentumUnit describes the units of momentum quantities (MeV or GeV)
type MomentumUnit int

// LengthUnit describes the units of length quantities (mm or cm)
type LengthUnit int

const (
	MEV MomentumUnit = iota // Momentum in MeV (default)
	GEV                     // Momentum in GeV
)

const (
	MM LengthUnit = iota // Length in mm (default)
	CM                   // Length in cm
)

func (mu MomentumUnit) String() string {
	switch mu {
	case MEV:
		return "MEV"
	case GEV:
		return "GEV"
	}
	err := fmt.Errorf("hepmc.units: invalid MomentumUnit value (%d)", int(mu))
	panic(err.Error())
}

// MomentumUnitFromString creates a MomentumUnit value from its string representation
func MomentumUnitFromString(s string) (MomentumUnit, error) {
	switch s {
	case "MEV":
		return MEV, nil
	case "GEV":
		return GEV, nil
	}
	err := fmt.Errorf("hepmc.units: invalid MomentumUnit string-value (%s)", s)
	return -1, err
}

func (lu LengthUnit) String() string {
	switch lu {
	case MM:
		return "MM"
	case CM:
		return "CM"
	}
	err := fmt.Errorf("hepmc.units: invalid LengthUnit value (%d)", int(lu))
	panic(err.Error())
}

// LengthUnitFromString creates a LengthUnit value from its string representation
func LengthUnitFromString(s string) (LengthUnit, error) {
	switch s {
	case "MM":
		return MM, nil
	case "CM":
		return CM, nil
	}
	err := fmt.Errorf("hepmc.units: invalid LengthUnit string-value (%s)", s)
	return -1, err
}

// EOF

{'fraction_non_alphanumeric': 0.12476722532588454, 'fraction_numerical': 0.0014897579143389199, 'mean_word_length': 3.3183279742765275, 'pattern_counts': {'":': 8, '<': 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': '1100079', 'n_tokens_mistral': 998, 'n_tokens_neox': 942, 'n_words': 310}