<commit_before>package Gosh::REST;

use strict;
use 5.018_001;
our $VERSION = '0.01';
use English qw< -no_match_vars >;

use Log::Log4perl::Tiny qw< :easy :dead_if_first LOGLEVEL >;
use Gosh::Model;
use Gosh::Util qw< plainify normalize_or_now >;
use Mojo::Base 'Mojolicious';
use YAML::Tiny;
use Data::Dumper;
$Data::Dumper::Indent = 1;

has 'model';

sub config {
   my $self = shift;
   my $filename = $ENV{GOSH_REST_CONFIG} // $self->moniker() . '.yml';
   return -e $filename ? YAML::Tiny::LoadFile($filename) : {};
}

sub startup {
   my $self = shift;

   DEBUG "$self";

   $self->moniker('Gosh-REST');
   $self->secrets(['Il Carrozzone']);

   my $config = $self->config();
   LOGLEVEL(uc($config->{loglevel} // 'DEBUG'));

   my $model = Gosh::Model->new(%{$config->{model} // {}});
   $self->model($model);

   my $r = $self->routes();
   $r->get('/' => \&root);

   $r->get('/account'               => \&list_accounts);
   $r->get('/account/:aid'          => \&retrieve_account);
   $r->get('/account/:aid/catalog'  => \&list_catalog);
   $r->get('/account/:aid/register' => \&list_register);
   $r->post('/account/:aid/register' => \&create_registration);
   $r->delete('/register/:rid'              => \&delete_registration);
   $r->delete('/account/:aid/register/:rid' => \&delete_registration);
<commit_msg>got rid of debug statement<commit_after>package Gosh::REST;

use strict;
use 5.018_001;
our $VERSION = '0.01';
use English qw< -no_match_vars >;

use Log::Log4perl::Tiny qw< :easy :dead_if_first LOGLEVEL >;
use Gosh::Model;
use Gosh::Util qw< plainify normalize_or_now >;
use Mojo::Base 'Mojolicious';
use YAML::Tiny;
use Data::Dumper;
$Data::Dumper::Indent = 1;

has 'model';

sub config {
   my $self = shift;
   my $filename = $ENV{GOSH_REST_CONFIG} // $self->moniker() . '.yml';
   return -e $filename ? YAML::Tiny::LoadFile($filename) : {};
}

sub startup {
   my $self = shift;

   $self->moniker('Gosh-REST');
   $self->secrets(['Il Carrozzone']);

   my $config = $self->config();
   LOGLEVEL(uc($config->{loglevel} // 'DEBUG'));

   my $model = Gosh::Model->new(%{$config->{model} // {}});
   $self->model($model);

   my $r = $self->routes();
   $r->get('/' => \&root);

   $r->get('/account'               => \&list_accounts);
   $r->get('/account/:aid'          => \&retrieve_account);
   $r->get('/account/:aid/catalog'  => \&list_catalog);
   $r->get('/account/:aid/register' => \&list_register);
   $r->post('/account/:aid/register' => \&create_registration);
   $r->delete('/register/:rid'              => \&delete_registration);
   $r->delete('/account/:aid/register/:rid' => \&delete_registration);

{'fraction_non_alphanumeric': 0.22575757575757577, 'fraction_numerical': 0.00909090909090909, 'mean_word_length': 3.6578483245149913, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 59, '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': '3550788', 'n_tokens_mistral': 1014, 'n_tokens_neox': 978, 'n_words': 180}