<commit_before>package gotop

import (
	"errors"
	"fmt"
	"io/ioutil"
	"strconv"
	"syscall"
	"time"
)

var (
	//Delay between samples
	Delay = 500 * time.Millisecond
)

func readFile(filename string) (string, error) {
	bytes, err := ioutil.ReadFile(filename)
	if err != nil {
		errorString := fmt.Sprintf("Could not read file %s .", filename)
		return "", errors.New(errorString)
	}
	return string(bytes), nil
}

type Systeminfo struct {
	Sysname  string
	Nodename string
	Release  string
	Version  string
	Machine  string
	CPUModel string
	NumCPU   int
	Memory string
}

func (s Systeminfo) String() string {
	return fmt.Sprintf("Sysname: %s\nNodename: %s\nRelease: %s\nVersion: %s\nMachine: %s\nModel: %s\nnumCPU: %d\nTotal memory:%s",
		s.Sysname, s.Nodename, s.Release, s.Version, s.Machine, s.CPUModel, s.NumCPU, s.Memory)	
}

func charToStr(input [65]int8) string {
	out := make([]byte, len(input))
	for i, val := range input {
		if val == 0 {
			break
		}
		out[i] = byte(val)
	}
	return string(out)
}	

func Sysinfo() Systeminfo {
	var uts syscall.Utsname
	syscall.Uname(&uts)
	sysname := charToStr(uts.Sysname)
	nodename := charToStr(uts.Nodename)
	release := charToStr(uts.Release)
	version := charToStr(uts.Version)
	machine := charToStr(uts.Machine)
	model := cpuModel()
	numCPU := numberOfCpus()
	memInfo, _ := getMemInfo()
	memory := float64(memInfo.MemTotal)/(1024*1024)
	memstr := strconv.FormatFloat(memory, 'f', 2, 64) + "GB"
	return Systeminfo{sysname, nodename, release, version, machine, model, numCPU, memstr}
}
<commit_msg>Add tabs to Systeminfo String()<commit_after>package gotop

import (
	"errors"
	"fmt"
	"io/ioutil"
	"strconv"
	"syscall"
	"time"
)

var (
	//Delay between samples
	Delay = 500 * time.Millisecond
)

func readFile(filename string) (string, error) {
	bytes, err := ioutil.ReadFile(filename)
	if err != nil {
		errorString := fmt.Sprintf("Could not read file %s .", filename)
		return "", errors.New(errorString)
	}
	return string(bytes), nil
}

type Systeminfo struct {
	Sysname  string
	Nodename string
	Release  string
	Version  string
	Machine  string
	CPUModel string
	NumCPU   int
	Memory   string
}

func (s Systeminfo) String() string {
	return fmt.Sprintf("Sysname: \t%s\nNodename: \t%s\nRelease: \t%s\nVersion: \t%s\nMachine: \t%s\nModel: \t\t%s\nCPU cores: \t%d\nTotal memory:\t%s",
		s.Sysname, s.Nodename, s.Release, s.Version, s.Machine, s.CPUModel, s.NumCPU, s.Memory)
}

func charToStr(input [65]int8) string {
	out := make([]byte, len(input))
	for i, val := range input {
		if val == 0 {
			break
		}
		out[i] = byte(val)
	}
	return string(out)
}

func Sysinfo() Systeminfo {
	var uts syscall.Utsname
	syscall.Uname(&uts)
	sysname := charToStr(uts.Sysname)
	nodename := charToStr(uts.Nodename)
	release := charToStr(uts.Release)
	version := charToStr(uts.Version)
	machine := charToStr(uts.Machine)
	model := cpuModel()
	numCPU := numberOfCpus()
	memInfo, _ := getMemInfo()
	memory := float64(memInfo.MemTotal) / (1024 * 1024)
	memstr := strconv.FormatFloat(memory, 'f', 2, 64) + "GB"
	return Systeminfo{sysname, nodename, release, version, machine, model, numCPU, memstr}
}
{'fraction_non_alphanumeric': 0.14527458492975734, 'fraction_numerical': 0.01277139208173691, 'mean_word_length': 4.310169491525424, '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': '4896107', 'n_tokens_mistral': 1255, 'n_tokens_neox': 1192, 'n_words': 289}