<commit_before>// THIS FILE IS AUTO-GENERATED BY CCGEN
// DO NOT MODIFY

package commandclass

type CommandClassID byte

const (
  {{range .CommandClasses}}
  {{.GetConstName}} CommandClassID = {{.Key}}{{end}}
)

func (c CommandClassID) String() string {
  switch c {
    {{range .CommandClasses}}
    case {{.GetConstName}}:
      return "{{.Help}}"
    {{end}}
    default:
      return "Unknown" + fmt.Sprintf(" (0x%X)", byte(c))
  }
}

func Parse(payload []byte) (interface{}, error) {
  switch CommandClassID(payload[0]) {
    {{range $_, $cc := .CommandClasses}}{{if .CanGen}}{{$version := .Version}}
    case {{.GetConstName}}:
      switch payload[1] {
        {{range .Commands}}case {{.Key}}:
          return {{$cc.GetPackageName}}.Parse{{(ToGoName .Name) "V" $version}}(payload), nil
        {{end}}default:
          return nil, errors.New("Unknown command in command class {{.Help}}")
      }
    {{end}}{{end}}

    default:<commit_msg>fix weird string formatting<commit_after>// THIS FILE IS AUTO-GENERATED BY CCGEN
// DO NOT MODIFY

package commandclass

type CommandClassID byte

const (
  {{range .CommandClasses}}
  {{.GetConstName}} CommandClassID = {{.Key}}{{end}}
)

func (c CommandClassID) String() string {
  switch c {
    {{range .CommandClasses}}
    case {{.GetConstName}}:
      return "{{.Help}}"
    {{end}}
    default:
      return fmt.Sprintf("Unknown (0x%X)", byte(c))
  }
}

func Parse(payload []byte) (interface{}, error) {
  switch CommandClassID(payload[0]) {
    {{range $_, $cc := .CommandClasses}}{{if .CanGen}}{{$version := .Version}}
    case {{.GetConstName}}:
      switch payload[1] {
        {{range .Commands}}case {{.Key}}:
          return {{$cc.GetPackageName}}.Parse{{(ToGoName .Name) "V" $version}}(payload), nil
        {{end}}default:
          return nil, errors.New("Unknown command in command class {{.Help}}")
      }
    {{end}}{{end}}

    default:
{'fraction_non_alphanumeric': 0.1857666143380429, 'fraction_numerical': 0.0031397174254317113, 'mean_word_length': 3.267857142857143, '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': '4414604', 'n_tokens_mistral': 616, 'n_tokens_neox': 612, 'n_words': 155}