<commit_before>package App::TMS::Client;
use strict;
our $VERSION = 0;

use Perl::Module;
use List::Util qw(max);
use Error qw(:try);
use Error::Simple;
use Error::Programatic;
use Data::Hub;
use Data::Hub::FileSystem::Node;
use Data::Format::Hash qw(hf_format);
use Data::Compare qw();
use Data::OrderedHash;
use Parse::Template::Standard;
use Data::Hub::Util qw(:all);
use App::TMS::Common;
use App::TMS::Debug;
use base 'App::Console::CommandScript';
use Cwd qw(cwd);
use File::Spec qw(rel2abs file_name_is_absolute);

our %USAGE = ();

# ------------------------------------------------------------------------------
# new - Construct a new instance
# new
# ------------------------------------------------------------------------------

sub new {
  my $classname = shift;
  my $client_dir = shift;
  my $client = Data::Hub->new($client_dir);
  my $repo_dir = $client->{"$TMS_SETTINGS/repo_dir"};
  my $repo = undef;
  try {
    my $abs = path_is_absolute($repo_dir) ? $repo_dir : path_join(cwd(), $repo_dir);
    $repo = $repo_dir ? Data::Hub->new($abs) : undef;
  } catch Error::Simple with {
    warnf "Current repository is invalid ($@): %s\n", $repo_dir;<commit_msg>Fix for running before connected to a repository.<commit_after>package App::TMS::Client;
use strict;
our $VERSION = 0;

use Perl::Module;
use List::Util qw(max);
use Error qw(:try);
use Error::Simple;
use Error::Programatic;
use Data::Hub;
use Data::Hub::FileSystem::Node;
use Data::Format::Hash qw(hf_format);
use Data::Compare qw();
use Data::OrderedHash;
use Parse::Template::Standard;
use Data::Hub::Util qw(:all);
use App::TMS::Common;
use App::TMS::Debug;
use base 'App::Console::CommandScript';
use Cwd qw(cwd);
use File::Spec qw(rel2abs file_name_is_absolute);

our %USAGE = ();

# ------------------------------------------------------------------------------
# new - Construct a new instance
# new
# ------------------------------------------------------------------------------

sub new {
  my $classname = shift;
  my $client_dir = shift;
  my $client = Data::Hub->new($client_dir);
  my $repo_dir = $client->{"$TMS_SETTINGS/repo_dir"};
  my $repo = undef;
  try {
    if ($repo_dir) {
      my $abs = path_is_absolute($repo_dir) ? $repo_dir : path_join(cwd(), $repo_dir);
      $repo = Data::Hub->new($abs);
    }
  } catch Error::Simple with {
    warnf "Current repository is invalid ($@): %s\n", $repo_dir;
{'fraction_non_alphanumeric': 0.2816020025031289, 'fraction_numerical': 0.001668752607425949, 'mean_word_length': 2.7063369397217927, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '1277277', 'n_tokens_mistral': 775, 'n_tokens_neox': 766, 'n_words': 198}