<commit_before>package components

import "github.com/scipipe/scipipe"

// StreamToSubStream takes a normal stream of InformationPacket's representing
// individual files, and returns one InformationPacket where the incoming IPs
// are sent on its substream.
type StreamToSubStream struct {
	scipipe.Process
	In           *scipipe.FilePort
	OutSubStream *scipipe.FilePort
}

// Instantiate a new StreamToSubStream
func NewStreamToSubStream() *StreamToSubStream {
	return &StreamToSubStream{}
}

// Run the StreamToSubStream
func (proc *StreamToSubStream) Run() {
	defer proc.OutSubStream.Close()

	subStreamIP := scipipe.NewInformationPacket("")
	subStreamIP.SubStream.Connect(proc.In)

	proc.OutSubStream.Chan <- subStreamIP
}

func (proc *StreamToSubStream) IsConnected() bool {
	return proc.In.IsConnected() && proc.OutSubStream.IsConnected()
}<commit_msg>Back to = syntax<commit_after>package components

import "github.com/scipipe/scipipe"

// StreamToSubStream takes a normal stream of InformationPacket's representing
// individual files, and returns one InformationPacket where the incoming IPs
// are sent on its substream.
type StreamToSubStream struct {
	scipipe.Process
	In           *scipipe.FilePort
	OutSubStream *scipipe.FilePort
}

// Instantiate a new StreamToSubStream
func NewStreamToSubStream() *StreamToSubStream {
	return &StreamToSubStream{}
}

// Run the StreamToSubStream
func (p *StreamToSubStream) Run() {
	defer p.OutSubStream.Close()

	subStreamIP := scipipe.NewInformationPacket("")
	subStreamIP.SubStream = p.In

	p.OutSubStream.Chan <- subStreamIP
}

func (p *StreamToSubStream) IsConnected() bool {
	return p.In.IsConnected() && p.OutSubStream.IsConnected()
}
{'fraction_non_alphanumeric': 0.0939161252215003, 'fraction_numerical': 0.0, 'mean_word_length': 5.07168458781362, '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': '4987812', 'n_tokens_mistral': 535, 'n_tokens_neox': 521, 'n_words': 135}