<commit_before>package engines

import (
	"github.com/taskcluster/taskcluster-worker/runtime/ioext"
)

// FileHandler is given as callback when iterating through a list of files.
//
// ResultSet.ExtractFolder(path, handler) takes a FileHandler as the handler
// parameter. This function maybe called sequentially or concurrently, but if
// it returns an the ResultSet should stop calling it and pass the error through
// as return value from ResultSet.ExtractFolder.
type FileHandler func(path string, stream ioext.ReadSeekCloser) error

// The ResultSet interface represents the results of a sandbox that has finished<commit_msg>Clarification of path in FileHandler<commit_after>package engines

import (
	"github.com/taskcluster/taskcluster-worker/runtime/ioext"
)

// FileHandler is given as callback when iterating through a list of files.
//
// ResultSet.ExtractFolder(path, handler) takes a FileHandler as the handler
// parameter. This function may be called sequentially or concurrently, but if
// it returns an the ResultSet should stop calling it and pass the error through
// as return value from ResultSet.ExtractFolder.
//
// The path argument is a relative path to the file, as in relative to the
// path given to ResultSet.ExtraFolder(path, handler). The path does not start
// with slash, but always uses slash as separator regardless of underlying OS.
//
// The stream argument is a read/seek/closer for the file, this can be the actual
// file, or a copy of the file, or some seekable stream interface.
type FileHandler func(path string, stream ioext.ReadSeekCloser) error

// The ResultSet interface represents the results of a sandbox that has finished
{'fraction_non_alphanumeric': 0.0645933014354067, 'fraction_numerical': 0.0, 'mean_word_length': 4.294303797468355, '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': '1960085', 'n_tokens_mistral': 426, 'n_tokens_neox': 420, 'n_words': 211}