<commit_before>package tasky

import "encoding/json"

type taskyWorker struct {
	w     Worker
	tasks []string
}

func (tw *taskyWorker) Name() string {
	return tw.w.Name()
}

func (tw *taskyWorker) Usage() string {
	return tw.w.Usage()
}

func (tw *taskyWorker) Perform(job []byte, dataCh chan []byte, errCh chan error, quitCh chan bool) {
	tw.w.Perform(job, dataCh, errCh, quitCh)
}

func (tw *taskyWorker) Status() string {
	return tw.w.Status()
}

func (tw *taskyWorker) Signal(act Action) bool {
	return tw.w.Signal(act)
}

func (tw *taskyWorker) MaxNumTasks() uint64 {
	return tw.w.MaxNumTasks()
}

type worker struct {
	Id    string
	Usage string
}

type ws struct {
	Workers []worker
}

// methods for routes to invoke
func listWorkers() ([]byte, error) {
	w := ws{}

	wMut.RLock()
	for k, v := range workers {
		t := worker{}
		t.Id = k
		t.Usage = v.Usage()

		if len(w.Workers) <= 0 {
			w.Workers = make([]worker, 1)
			w.Workers[0] = t
		} else {
			w.Workers = append(w.Workers, t)
		}<commit_msg>updated json tags for structs<commit_after>package tasky

import (
	"encoding/json"
	"strings"
)

type taskyWorker struct {
	w     Worker
	tasks []string
}

func (tw *taskyWorker) Name() string {
	return tw.w.Name()
}

func (tw *taskyWorker) Usage() string {
	return tw.w.Usage()
}

func (tw *taskyWorker) Perform(job []byte, dataCh chan []byte, errCh chan error, quitCh chan bool) {
	tw.w.Perform(job, dataCh, errCh, quitCh)
}

func (tw *taskyWorker) Status() string {
	return tw.w.Status()
}

func (tw *taskyWorker) Signal(act Action) bool {
	return tw.w.Signal(act)
}

func (tw *taskyWorker) MaxNumTasks() uint64 {
	return tw.w.MaxNumTasks()
}

type worker struct {
	Id    string `json:"name"`
	Usage string `json:"usage"`
}

type ws struct {
	Workers []worker `json:"workers"`
}

// methods for routes to invoke
func listWorkers() ([]byte, error) {
	w := ws{}

	wMut.RLock()
	for k, v := range workers {
		t := worker{}
		t.Id = k
		t.Usage = v.Usage()

		if len(w.Workers) <= 0 {
			w.Workers = make([]worker, 1)
			w.Workers[0] = t
		} else {
			w.Workers = append(w.Workers, t)
		}
{'fraction_non_alphanumeric': 0.15204957102001906, 'fraction_numerical': 0.004766444232602479, 'mean_word_length': 3.5531453362255965, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1496421', 'n_tokens_mistral': 861, 'n_tokens_neox': 809, 'n_words': 232}