<commit_before>package wire

type Wire struct {
	in  *input
	out *output
	tr  *transform

	Config *Config
}

func New(config *Config) *Wire {
	w := new(Wire)
	if config == nil {
		w.Config = &DefaultConfig
	} else {
		w.Config = config
	}
	return w
}

func (w *Wire) Start(in Inputter, out Outputter, transformer Transformer, errs chan error) error {
	in_messages := make(chan interface{}, w.Config.BufferSize)
	out_messages := make(chan interface{}, w.Config.BufferSize)

	w.in = newInput(in)
	if err := w.in.start(w.Config.NumberOfInputters, in_messages, errs); err != nil {
		return err
	}

	w.tr = newTransform(transformer)
	if err := w.tr.start(w.Config.NumberOfTransformers, in_messages, out_messages, errs); err != nil {
		return err
	}

	w.out = newOutput(out, in)
	if err := w.out.start(w.Config.NumberOfOutputters, out_messages, errs); err != nil {
		return err
	}

	return nil
}

func (w *Wire) Close() error {
	if err := w.in.close(); err != nil {
		return err
	}
	return w.out.close()
}
<commit_msg>Adds inputter, outputter, and trasnformer multiplicity default to 1 if 0.<commit_after>package wire

type Wire struct {
	in  *input
	out *output
	tr  *transform

	Config *Config
}

func New(config *Config) *Wire {
	w := new(Wire)
	if config == nil {
		w.Config = &DefaultConfig
	} else {
		w.Config = config
	}
	if w.Config.NumberOfInputters == 0 {
		w.Config.NumberOfInputters = 1
	}
	if w.Config.NumberOfTransformers == 0 {
		w.Config.NumberOfTransformers = 1
	}
	if w.Config.NumberOfOutputters == 0 {
		w.Config.NumberOfOutputters = 1
	}
	return w
}

func (w *Wire) Start(in Inputter, out Outputter, transformer Transformer, errs chan error) error {
	in_messages := make(chan interface{}, w.Config.BufferSize)
	out_messages := make(chan interface{}, w.Config.BufferSize)

	w.in = newInput(in)
	if err := w.in.start(w.Config.NumberOfInputters, in_messages, errs); err != nil {
		return err
	}

	w.tr = newTransform(transformer)
	if err := w.tr.start(w.Config.NumberOfTransformers, in_messages, out_messages, errs); err != nil {
		return err
	}

	w.out = newOutput(out, in)
	if err := w.out.start(w.Config.NumberOfOutputters, out_messages, errs); err != nil {
		return err
	}

	return nil
}

func (w *Wire) Close() error {
	if err := w.in.close(); err != nil {
		return err
	}
	return w.out.close()
}

{'fraction_non_alphanumeric': 0.1331028522039758, 'fraction_numerical': 0.003457216940363008, 'mean_word_length': 3.79296066252588, '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': '5050829', 'n_tokens_mistral': 887, 'n_tokens_neox': 840, 'n_words': 227}