<commit_before>package main

import (
       "fmt"
       "os"
)


func check(e error){
     if e != nil {
     panic(e)
     }
}

func main (){
     if len(os.Args) < 2 {
     	fmt.Println("Usage:", os.Args[0], "file.mfd")
	os.Exit(1)
	}
    f, err := os.Open(os.Args[1])
    check(err)
 
    buffer := make([]byte, 5)
    _, err = f.Read(buffer)
    f.Close()
    
    fmt.Printf("4 first bytes (UID): % X\n", buffer[0:4])
    result := buffer[0] ^ buffer[1] ^ buffer[2] ^ buffer[3]
    if result == buffer[4] {
       fmt.Printf("Parity byte (5) is %X, just as expected.\n", result)
    } else {
        fmt.Printf("Parity byte (5) should be %X, but currently is %X\n", result, buffer[4])
       fmt.Printf("Fix? (y/N) ")
       var a byte
       fmt.Scanf("%c", &a)
       if a == 121 || a == 89 {
       	  buffer[4] = result
	  f, err := os.OpenFile(os.Args[1], os.O_RDWR, 0660)
	  check(err)
	  _, err = f.Write(buffer)
	  defer f.Close()
      } else {
       	 os.Exit(1)
       }
    }
}<commit_msg>gofmt<commit_after>package main

import (
	"fmt"
	"os"
)

func check(e error) {
	if e != nil {
		panic(e)
	}
}

func main() {
	if len(os.Args) < 2 {
		fmt.Println("Usage:", os.Args[0], "file.mfd")
		os.Exit(1)
	}
	f, err := os.Open(os.Args[1])
	check(err)

	buffer := make([]byte, 5)
	_, err = f.Read(buffer)
	f.Close()

	fmt.Printf("4 first bytes (UID): % X\n", buffer[0:4])
	result := buffer[0] ^ buffer[1] ^ buffer[2] ^ buffer[3]
	if result == buffer[4] {
		fmt.Printf("Parity byte (5) is %X, just as expected.\n", result)
	} else {
		fmt.Printf("Parity byte (5) should be %X, but currently is %X\n", result, buffer[4])
		fmt.Printf("Fix? (y/N) ")
		var a byte
		fmt.Scanf("%c", &a)
		if a == 121 || a == 89 {
			buffer[4] = result
			f, err := os.OpenFile(os.Args[1], os.O_RDWR, 0660)
			check(err)
			_, err = f.Write(buffer)
			defer f.Close()
		} else {
			os.Exit(1)
		}
	}
}
{'fraction_non_alphanumeric': 0.19978858350951373, 'fraction_numerical': 0.02959830866807611, 'mean_word_length': 2.4355716878402904, 'pattern_counts': {'":': 0, '<': 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': '6386348', 'n_tokens_mistral': 841, 'n_tokens_neox': 794, 'n_words': 186}