<commit_before>// +build linux

package minion

import (
	"bytes"
	"os/exec"
	"strings"
)

func init() {
	Register("lsbdistid", idProvider)
	Register("lsbdistdesc", descProvider)
	Register("lsbdistrelease", releaseProvider)
	Register("lsbdistcodename", codenameProvider)
}

func runLSBreleaseTool(args ...string) (string, error) {
	var buf bytes.Buffer

	cmd := exec.Command("/usr/bin/lsb_release", args...)
	cmd.Stdout = &buf
	err := cmd.Run()

	if err != nil {
		return "", err
	}

	data := strings.Split(buf.String(), ":")
	result := strings.TrimSpace(data[1])

	return result, nil
}

func idProvider() (string, error) {
	return runLSBreleaseTool("--id")
}

func descProvider() (string, error) {
	return runLSBreleaseTool("--description")
}

func releaseProvider() (string, error) {
	return runLSBreleaseTool("--release")
}

func codenameProvider() (string, error) {
	return runLSBreleaseTool("--codename")
}
<commit_msg>Fix the LSB classifier package name<commit_after>// +build linux

package classifier

import (
	"bytes"
	"os/exec"
	"strings"
)

func init() {
	Register("lsbdistid", idProvider)
	Register("lsbdistdesc", descProvider)
	Register("lsbdistrelease", releaseProvider)
	Register("lsbdistcodename", codenameProvider)
}

func runLSBreleaseTool(args ...string) (string, error) {
	var buf bytes.Buffer

	cmd := exec.Command("/usr/bin/lsb_release", args...)
	cmd.Stdout = &buf
	err := cmd.Run()

	if err != nil {
		return "", err
	}

	data := strings.Split(buf.String(), ":")
	result := strings.TrimSpace(data[1])

	return result, nil
}

func idProvider() (string, error) {
	return runLSBreleaseTool("--id")
}

func descProvider() (string, error) {
	return runLSBreleaseTool("--description")
}

func releaseProvider() (string, error) {
	return runLSBreleaseTool("--release")
}

func codenameProvider() (string, error) {
	return runLSBreleaseTool("--codename")
}

{'fraction_non_alphanumeric': 0.16115261472785486, 'fraction_numerical': 0.0010672358591248667, 'mean_word_length': 4.9335443037974684, 'pattern_counts': {'":': 2, '<': 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': '3576705', 'n_tokens_mistral': 656, 'n_tokens_neox': 639, 'n_words': 145}