<commit_before>package TestConnection;

use strict;
use warnings;
use parent 'AnyEvent::XMPP::IM::Connection';

use 5.010;

our $HOST         = 'localhost';
our $TIMEOUT      = 5;
our %PASSWORD_FOR = (
    one   => '<PASSWORD>',
    two   => '<PASSWORD>',
    three => '34512',
    four  => '45123',
    five  => '51234',
    six   => '123456',
);

sub new {
    my ( $class, $username, %options ) = @_;

    my $cond  = AnyEvent->condvar;
    my $timer = AnyEvent->timer(
        after => $TIMEOUT,
        cb    => sub {
            $cond->send('timeout');
        },
    );

    my $self = $class->SUPER::new(
        username => $username,
        domain   => $HOST,
        password => $options{'password'} // $PASSWORD_FOR{$username},
    );

    $self->reg_cb(error => sub {
        my ( undef, $error ) = @_;

        $cond->send($error->string);<commit_msg>Add password for user '<PASSWORD>'<commit_after>package TestConnection;

use strict;
use warnings;
use parent 'AnyEvent::XMPP::IM::Connection';

use 5.010;

our $HOST         = 'localhost';
our $TIMEOUT      = 5;
our %PASSWORD_FOR = (
    one   => '<PASSWORD>',
    two   => '<PASSWORD>',
    three => '<PASSWORD>',
    four  => '45123',
    five  => '51234',
    six   => '123456',
    seven => '1234567',
);

sub new {
    my ( $class, $username, %options ) = @_;

    my $cond  = AnyEvent->condvar;
    my $timer = AnyEvent->timer(
        after => $TIMEOUT,
        cb    => sub {
            $cond->send('timeout');
        },
    );

    my $self = $class->SUPER::new(
        username => $username,
        domain   => $HOST,
        password => $options{'password'} // $PASSWORD_FOR{$username},
    );

    $self->reg_cb(error => sub {
        my ( undef, $error ) = @_;

        $cond->send($error->string);
{'fraction_non_alphanumeric': 0.18462401795735128, 'fraction_numerical': 0.030303030303030304, 'mean_word_length': 2.2184115523465704, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 48, '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': '112203', 'n_tokens_mistral': 632, 'n_tokens_neox': 594, 'n_words': 133}