<commit_before>package main

import (
	"encoding/base64"
	"fmt"
	"github.com/docopt/docopt-go"
	"io"
	"os"
)

const (
	version = `base64 (go coretuils) 0.1
Packaged by <NAME>
Copyright (c) 2014 <NAME>
MIT
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by <NAME>`

	usage = `Usage: base64 [-di --wrap=<COLS>] [FILE]
Base64 encode or decode FILE, or standard input, to standard output.

  -d, --decode          decode data
  -i, --ignore-garbage  when decoding, ignore non-alphabet characters
  -w, --wrap=COLS       wrap encoded lines after COLS character (default 76).

	  --help     display this help and exit
	  --version  output version information and exit

With no FILE, or when FILE is -, read standard input.

The data are encoded as describe for base64 alpahbet in RFC 4648.
When decoding, the input may contain new lines in addition to the bytes of
the format base64 alphabet. Use --ignore-garbage to attempt to recover
from any other non-alphabet bytes in the encoded stream.`
)

func main() {
	arguments, err := docopt.Parse(usage, nil, true, version, false)
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}

	var decode = arguments["-d"].(bool)
	if decode == true {
		d := base64.NewDecoder(base64.StdEncoding, os.Stdin)
		defer os.Stdin.Close()
		io.Copy(os.Stdout, d)
	} else {
		e := base64.NewEncoder(base64.StdEncoding, os.Stdout)
		defer e.Close()
		io.Copy(e, os.Stdin)
	}
}
<commit_msg>cleanup if decode in base64<commit_after>package main

import (
	"encoding/base64"
	"fmt"
	"github.com/docopt/docopt-go"
	"io"
	"os"
)

const (
	version = `base64 (go coretuils) 0.1
Packaged by <NAME>
Copyright (c) 2014 <NAME>
MIT
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by <NAME>`

	usage = `Usage: base64 [-di --wrap=<COLS>] [FILE]
Base64 encode or decode FILE, or standard input, to standard output.

  -d, --decode          decode data
  -i, --ignore-garbage  when decoding, ignore non-alphabet characters
  -w, --wrap=COLS       wrap encoded lines after COLS character (default 76).

	  --help     display this help and exit
	  --version  output version information and exit

With no FILE, or when FILE is -, read standard input.

The data are encoded as describe for base64 alpahbet in RFC 4648.
When decoding, the input may contain new lines in addition to the bytes of
the format base64 alphabet. Use --ignore-garbage to attempt to recover
from any other non-alphabet bytes in the encoded stream.`
)

func main() {
	arguments, err := docopt.Parse(usage, nil, true, version, false)
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}

	var decode = arguments["-d"].(bool)
	if decode {
		d := base64.NewDecoder(base64.StdEncoding, os.Stdin)
		defer os.Stdin.Close()
		io.Copy(os.Stdout, d)
	} else {
		e := base64.NewEncoder(base64.StdEncoding, os.Stdout)
		defer e.Close()
		io.Copy(e, os.Stdin)
	}
}

{'fraction_non_alphanumeric': 0.10903010033444815, 'fraction_numerical': 0.02274247491638796, 'mean_word_length': 3.431111111111111, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '1737497', 'n_tokens_mistral': 1071, 'n_tokens_neox': 985, 'n_words': 377}