<commit_before>package main

import (
	"fmt"
	"time"

	"strconv"
	"strings"
)

func usedMemory() (string, error) {
	out, err := pipedCommands.Output(
		[]string{"ps", "auxw"},
		[]string{"grep", "[u]nicorn"},
		[]string{"awk", "{m+=$6*1024} END{print m;}"},
	)
	if err != nil {
		return "", fmt.Errorf("Cannot get unicorn used memory: %s", err)
	}
	return strings.Trim(string(out), "\n"), nil
}

func averageMemory() (string, error) {
	out, err := pipedCommands.Output(
		[]string{"ps", "auxw"},
		[]string{"grep", "[u]nicorn"},
		[]string{"grep", "-v", "master"},
		[]string{"awk", "{mem=$6*1024+mem; proc++} END{printf(\"%d\n\", mem/proc)}"},
	)
	if err != nil {
		return "", fmt.Errorf("Cannot get unicorn memory average: %s", err)
	}
	return strings.Trim(string(out), "\n"), nil
}

func idleWorkerCount(pids []string) (int, error) {
	var beforeCpu []string
	var afterCpu []string
	idles := 0

	for _, pid := range pids {
		cputime, err := cpuTime(pid)
		if err != nil {
			return idles, err
		}
		beforeCpu = append(beforeCpu, cputime)
	}
	time.Sleep(1 * time.Second)
	for _, pid := range pids {
		cputime, err := cpuTime(pid)
		if err != nil {<commit_msg>use print intead of printf<commit_after>package main

import (
	"fmt"
	"time"

	"strconv"
	"strings"
)

func usedMemory() (string, error) {
	out, err := pipedCommands.Output(
		[]string{"ps", "auxw"},
		[]string{"grep", "[u]nicorn"},
		[]string{"awk", "{m+=$6*1024} END{print m;}"},
	)
	if err != nil {
		return "", fmt.Errorf("Cannot get unicorn used memory: %s", err)
	}
	return strings.Trim(string(out), "\n"), nil
}

func averageMemory() (string, error) {
	out, err := pipedCommands.Output(
		[]string{"ps", "auxw"},
		[]string{"grep", "[u]nicorn"},
		[]string{"grep", "-v", "master"},
		[]string{"awk", "{mem=$6*1024+mem; proc++} END{print mem/proc}"},
	)
	if err != nil {
		return "", fmt.Errorf("Cannot get unicorn memory average: %s", err)
	}
	return strings.Trim(string(out), "\n"), nil
}

func idleWorkerCount(pids []string) (int, error) {
	var beforeCpu []string
	var afterCpu []string
	idles := 0

	for _, pid := range pids {
		cputime, err := cpuTime(pid)
		if err != nil {
			return idles, err
		}
		beforeCpu = append(beforeCpu, cputime)
	}
	time.Sleep(1 * time.Second)
	for _, pid := range pids {
		cputime, err := cpuTime(pid)
		if err != nil {
{'fraction_non_alphanumeric': 0.2089616544592848, 'fraction_numerical': 0.01034037052994399, 'mean_word_length': 4.20627802690583, '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': '5265845', 'n_tokens_mistral': 950, 'n_tokens_neox': 892, 'n_words': 228}