<commit_before>package main

import (
	"fmt"
	"flag"
	"hash/fnv"
	"io/ioutil"
	"log"
	"os"
)

func main() {
	flag.Parse()
	log.SetFlags(log.Lshortfile)

	// Open file if passed in.
	var file *os.File
	var err error
	if flag.NArg() > 0 {
		file, err = os.Open(flag.Arg(0))
		if err != nil {
			log.Fatal(err)
		}
	}

	// Slurp the input.
	b, err := ioutil.ReadAll(file)
	if err != nil {
		log.Fatal(err)
	}

	// Hash the input and print the hash to stdout.
	h := fnv.New64a()
	h.Reset()
	h.Write(b)<commit_msg>Fix STDIN.<commit_after>package main

import (
	"fmt"
	"flag"
	"hash/fnv"
	"io/ioutil"
	"log"
	"os"
)

func main() {
	flag.Parse()
	log.SetFlags(log.Lshortfile)

	// Open file if passed in.
	var file *os.File = os.Stdin
	var err error
	if flag.NArg() > 0 {
		file, err = os.Open(flag.Arg(0))
		if err != nil {
			log.Fatal(err)
		}
	}

	// Slurp the input.
	b, err := ioutil.ReadAll(file)
	if err != nil {
		log.Fatal(err)
	}

	// Hash the input and print the hash to stdout.
	h := fnv.New64a()
	h.Reset()
	h.Write(b)
{'fraction_non_alphanumeric': 0.16861598440545808, 'fraction_numerical': 0.007797270955165692, 'mean_word_length': 2.721014492753623, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4448589', 'n_tokens_mistral': 493, 'n_tokens_neox': 465, 'n_words': 115}