<commit_before>package main

import (
	"errors"
	"fmt"
	"math/rand"
	"runtime"
	"sync"
	"time"

	"github.com/ready-steady/format/mat"
	"github.com/ready-steady/numeric/interpolation/adhier"
	"github.com/ready-steady/probability"
	"github.com/ready-steady/probability/uniform"

	"../internal"
)

var startTime = time.Now().Unix()

func main() {
	internal.Run(command)
}

func command(config internal.Config, input *mat.File, output *mat.File) error {
	if input == nil {
		return errors.New("an input file is required")
	}

	if config.Verbose {
		fmt.Println("Processing the original model...")
	}
	observations, observationPoints, err := observe(config)
	if err != nil {
		return err
	}
	if config.Verbose {
		fmt.Println("Done.")
	}

	if config.Verbose {
		fmt.Println("Processing the surrogate model...")
	}
	predictions, predictionPoints, surrogate, err := predict(config, input)
	if err != nil {
		return err
	}
	if config.Verbose {
		fmt.Println("Done.")
	}

	if output == nil {
		return nil
	}

	lc, sc := config.Assessment.Slices, config.Assessment.Samples

	oc := uint(len(observations)) / (lc * sc)
	ic := uint(len(observationPoints)) / (lc * sc)

	if err := output.PutArray("observations", observations, oc, sc, lc); err != nil {
		return err
	}
	if err := output.PutArray("observationPoints", observationPoints, ic, sc, lc); err != nil {
		return err
	}

	ic = uint(len(predictionPoints)) / (lc * sc)

	if err := output.PutArray("predictions", predictions, oc, sc, lc); err != nil {<commit_msg>Fixed a bug in cmd/sample<commit_after>package main

import (
	"errors"
	"fmt"
	"math/rand"
	"runtime"
	"sync"
	"time"

	"github.com/ready-steady/format/mat"
	"github.com/ready-steady/numeric/interpolation/adhier"
	"github.com/ready-steady/probability"
	"github.com/ready-steady/probability/uniform"

	"../internal"
)

var startTime = time.Now().Unix()

func main() {
	internal.Run(command)
}

func command(config internal.Config, input *mat.File, output *mat.File) error {
	if input == nil {
		return errors.New("an input file is required")
	}

	if config.Verbose {
		fmt.Println("Processing the original model...")
	}
	observations, observationPoints, err := observe(config)
	if err != nil {
		return err
	}
	if config.Verbose {
		fmt.Println("Done.")
	}

	if config.Verbose {
		fmt.Println("Processing the surrogate model...")
	}
	predictions, predictionPoints, surrogate, err := predict(config, input)
	if err != nil {
		return err
	}
	if config.Verbose {
		fmt.Println("Done.")
	}

	if output == nil {
		return nil
	}

	lc, sc := config.Assessment.Slices, config.Assessment.Samples
	if lc == 0 {
		lc = 1
	}

	oc := uint(len(observations)) / (lc * sc)
	ic := uint(len(observationPoints)) / (lc * sc)

	if err := output.PutArray("observations", observations, oc, sc, lc); err != nil {
		return err
	}
	if err := output.PutArray("observationPoints", observationPoints, ic, sc, lc); err != nil {
		return err
	}

	ic = uint(len(predictionPoints)) / (lc * sc)

	if err := output.PutArray("predictions", predictions, oc, sc, lc); err != nil {
{'fraction_non_alphanumeric': 0.1556139198949442, 'fraction_numerical': 0.0006565988181221273, 'mean_word_length': 3.8441971383147853, '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': '872111', 'n_tokens_mistral': 1142, 'n_tokens_neox': 1088, 'n_words': 263}