<commit_before>package main

import (
	"fmt"
	"go/parser"
	"go/token"
	"os"
	"strings"
)

const VERSION = "0.0.1"

var fset *token.FileSet

func main() {
	if len(os.Args) != 2 {
		printUsage()
		os.Exit(1)
	}

	filename := os.Args[1]

	fset = token.NewFileSet()

	f, err := parser.ParseFile(fset, filename, nil, 0)
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}

	// header
	fmt.Println("!_TAG_FILE_FORMAT\t2\t")
	fmt.Println("!_TAG_FILE_SORTED\t0\t")

	// package
	if f.Name != nil {
		printTag(f.Name.Name, "p", f.Name.Pos())
	}

	// imports
	for _, im := range f.Imports {
		if im.Path != nil {
			printTag(strings.Trim(im.Path.Value, "\""), "i", im.Path.Pos())
		}
	}
}

func printUsage() {<commit_msg>Print functions<commit_after>package main

import (
	"fmt"
	"go/ast"
	"go/parser"
	"go/token"
	"os"
	"strings"
)

const VERSION = "0.0.1"

var fset *token.FileSet

func main() {
	if len(os.Args) != 2 {
		printUsage()
		os.Exit(1)
	}

	filename := os.Args[1]

	fset = token.NewFileSet()

	f, err := parser.ParseFile(fset, filename, nil, 0)
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}

	// header
	fmt.Println("!_TAG_FILE_FORMAT\t2\t")
	fmt.Println("!_TAG_FILE_SORTED\t0\t")

	// package
	if f.Name != nil {
		printTag(f.Name.Name, "p", f.Name.Pos())
	}

	// imports
	for _, im := range f.Imports {
		if im.Path != nil {
			printTag(strings.Trim(im.Path.Value, "\""), "i", im.Path.Pos())
		}
	}

	// declarations
	for _, d := range f.Decls {
		if fd, ok := d.(*ast.FuncDecl); ok {
			if fd.Name != nil {
				// TODO: add params, receiver, etc
				printTag(fd.Name.Name, "f", fd.Pos())
			}
		}
	}
}

func printUsage() {
{'fraction_non_alphanumeric': 0.1986552567237164, 'fraction_numerical': 0.012224938875305624, 'mean_word_length': 2.9256594724220624, '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': '3530686', 'n_tokens_mistral': 773, 'n_tokens_neox': 724, 'n_words': 141}