<commit_before>package Moth;
use strict; use warnings;

use HTTP::Tiny;
use JSON;
use URI;

my $base_url_template = "http://%s:%s/_sql";

my $json = JSON->new()->utf8(1);

sub new {
    my ($class, $host, $port) = @_;
    
    my $self = {
        host => $host,
        port => $port,
        query_url => undef,
    };
    
    $self->{query_url} = URI->new(
        sprintf($base_url_template, $host, $port)
    );
    
    bless $self, ref($class)||$class;
    
    return $self;
}

# TODO Pull these out into a separate module<commit_msg>Add missing import for Data::Dumper<commit_after>package Moth;
use strict; use warnings;

use HTTP::Tiny;
use JSON;
use URI;

use Data::Dumper;

my $base_url_template = "http://%s:%s/_sql";

my $json = JSON->new()->utf8(1);

sub new {
    my ($class, $host, $port) = @_;
    
    my $self = {
        host => $host,
        port => $port,
        query_url => undef,
    };
    
    $self->{query_url} = URI->new(
        sprintf($base_url_template, $host, $port)
    );
    
    bless $self, ref($class)||$class;
    
    return $self;
}

# TODO Pull these out into a separate module
{'fraction_non_alphanumeric': 0.16770186335403728, 'fraction_numerical': 0.00354924578527063, 'mean_word_length': 2.525, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '541396', 'n_tokens_mistral': 412, 'n_tokens_neox': 411, 'n_words': 105}