<commit_before>package Error::Pure::Output::Bio;

# Pragmas.
use base qw(Exporter);
use strict;
use warnings;

# Modules.
use Readonly;

# Constants.
Readonly::Array our @EXPORT => qw(err_bio);
Readonly::Scalar my $SPACE => q{ };

# Version.
our $VERSION = 0.01;

# Bio error print.
sub err_bio {
	my $errors_ar = shift;
	my $ret;
	foreach my $error_hr (@{$errors_ar}) {
		my $e = shift @{$error_hr->{'msg'}};
		chomp $e;

		# Title.
		# XXX Add class.
		my $title = '------------- EXCEPTION -------------';
		$ret .= $title;

		# Error.
		$ret .= 'MSG: '.$e."\n";

		# Value.
		while (@{$error_hr->{'msg'}}) {
			my $f = shift @{$error_hr->{'msg'}};
			my $t = shift @{$error_hr->{'msg'}};

			if (! defined $f) {
				last;
			}
			$ret .= 'VALUE: '.$f;
			if ($t) {
				$ret .= ': '.$t;
			}
			$ret .= "\n";
		}

		# Stack trace.
		foreach my $i (0 .. $#{$error_hr->{'stack'}}) {
			my $st = $error_hr->{'stack'}->[$i];
			$ret .= 'STACK: '.$st->{'class'};
			$ret .= $SPACE.$st->{'prog'};
			$ret .= ':'.$st->{'line'};
			$ret .= "\n";
		}

		# Footer.
		my $footer = length($title);
		$ret .= $footer;
	}
	return $ret;
}

1;<commit_msg>Fix output.<commit_after>package Error::Pure::Output::Bio;

# Pragmas.
use base qw(Exporter);
use strict;
use warnings;

# Modules.
use Readonly;

# Constants.
Readonly::Array our @EXPORT => qw(err_bio);
Readonly::Scalar my $SPACE => q{ };

# Version.
our $VERSION = 0.01;

# Bio error print.
sub err_bio {
	my $errors_ar = shift;
	my $ret;
	foreach my $error_hr (@{$errors_ar}) {
		my $e = shift @{$error_hr->{'msg'}};
		chomp $e;

		# Title.
		# XXX Add class.
		my $title = '------------- EXCEPTION -------------';
		$ret .= $title."\n";

		# Error.
		$ret .= 'MSG: '.$e."\n";

		# Value.
		while (@{$error_hr->{'msg'}}) {
			my $f = shift @{$error_hr->{'msg'}};
			my $t = shift @{$error_hr->{'msg'}};

			if (! defined $f) {
				last;
			}
			$ret .= 'VALUE: '.$f;
			if ($t) {
				$ret .= ': '.$t;
			}
			$ret .= "\n";
		}

		# Stack trace.
		foreach my $i (0 .. $#{$error_hr->{'stack'}}) {
			my $st = $error_hr->{'stack'}->[$i];
			$ret .= 'STACK: '.$st->{'class'};
			$ret .= $SPACE.$st->{'prog'};
			$ret .= ':'.$st->{'line'};
			$ret .= "\n";
		}

		# Footer.
		my $footer = ('-' x length($title))."\n";
		$ret .= $footer;
	}
	return $ret;
}

1;
{'fraction_non_alphanumeric': 0.27763272410791995, 'fraction_numerical': 0.004351610095735422, 'mean_word_length': 2.4623493975903616, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, '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': '5723941', 'n_tokens_mistral': 1086, 'n_tokens_neox': 964, 'n_words': 223}