<commit_before>package main

import (
	"fmt"
	"io"
	"net/mail"
	"os"
)

var exitCode = 0

// Header Parser (hp) takes an email message as input and returns
//  the message's headers.

// For now, just take input on standard in, assuming one message
//  at a time.
// Later, allow user to specify a filename, or directory as args.

func processStdin(in io.Reader, out io.Writer) error {
	msg, err := mail.ReadMessage(in)
	if err != nil {
		return err
	}

	subject := msg.Header.Get("Subject")
	fmt.Printf("%v", subject)
	return nil
}

func main() {
	if err := processStdin(os.Stdin, os.Stdout); err != nil {
		fmt.Printf("%v", err)
		exitCode = 2
	}
	os.Exit(exitCode)
}<commit_msg>Echo all headers out<commit_after>package main

import (
	"fmt"
	"io"
	"net/mail"
	"os"
)

var exitCode = 0

// Header Parser (hp) takes an email message as input and returns
//  the message's headers.

// For now, just take input on standard in, assuming one message
//  at a time.
// Later, allow user to specify a filename, or directory as args.

func processStdin(in io.Reader, out io.Writer) error {
	msg, err := mail.ReadMessage(in)
	if err != nil {
		return err
	}

	//subject := msg.Header.Get("Subject")
	for k, v := range msg.Header {
		fmt.Printf("%v: %v\n", k, v)
	}
	return nil
}

func main() {
	if err := processStdin(os.Stdin, os.Stdout); err != nil {
		fmt.Printf("%v", err)
		exitCode = 2
	}
	os.Exit(exitCode)
}
{'fraction_non_alphanumeric': 0.14184397163120568, 'fraction_numerical': 0.0028368794326241137, 'mean_word_length': 3.2628398791540785, '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': '2790390', 'n_tokens_mistral': 527, 'n_tokens_neox': 514, 'n_words': 174}