<commit_before>role CompUnitRepo::Locally {
    has Lock     $!lock;
    has IO::Path $.path;
    has Str      $!WHICH;

    my %instances;

    method new($dir) {
        my $path := IO::Path.new-from-absolute-path($*SPEC.rel2abs($dir));
        return Nil unless $path.d and $path.r;
        %instances{$path.abspath} //= self.bless(:$path, :lock(Lock.new));
    }

    multi method WHICH (CompUnitRepo::Locally:D:) {
        $!WHICH //= self.^name ~ '|' ~ $!path.abspath;
    }
    method Str   { self.DEFINITE ?? $!path.abspath !! Nil }
    method gist  { self.DEFINITE
      ?? "{self.short-id}:{$!path.abspath}"
      !! self.^name;
    }
    method perl  { self.DEFINITE
      ?? "CompUnitRepo.new('{self.short-id}:{$!path.abspath}')"
      !! self.^name;
    }

    # stubs
    method install    ($source, $from?             ) { ... }
    method files      ($file, :$name, :$auth, :$ver) { ... }
    method candidates ($name, :$file, :$auth, :$ver) { ... }
    method short-id   (                            ) { ... }
}<commit_msg>Fix some signatures and simplify methods<commit_after>role CompUnitRepo::Locally {
    has Lock     $!lock;
    has IO::Path $.path;
    has Str      $!WHICH;

    my %instances;

    method new(CompUnitRepo::Locally: $dir) {
        my $path := IO::Path.new-from-absolute-path($*SPEC.rel2abs($dir));
        return Nil unless $path.d and $path.r;
        %instances{$path.abspath} //= self.bless(:$path, :lock(Lock.new));
    }

    multi method WHICH (CompUnitRepo::Locally:D:) {
        $!WHICH //= self.^name ~ '|' ~ $!path.abspath;
    }
    method Str(CompUnitRepo::Locally:D:) { $!path.abspath }
    method gist(CompUnitRepo::Locally:D:) {
      "{self.short-id}:{$!path.abspath}"
    }
    method perl(CompUnitRepo::Locally:D:) {
      "CompUnitRepo.new('{self.short-id}:{$!path.abspath}')"
    }

    # stubs
    method install(CompUnitRepo::Locally:D: $source, $from? )             {...}
    method files(CompUnitRepo::Locally:D: $file, :$name, :$auth, :$ver)   {...}
    method candidates(CompUnitRepo::Locally:D: $name,:$file,:$auth,:$ver) {...}
    method short-id(CompUnitRepo::Locally:D:)                             {...}
}
{'fraction_non_alphanumeric': 0.19467401285583102, 'fraction_numerical': 0.0009182736455463728, 'mean_word_length': 2.3940809968847354, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2954600', 'n_tokens_mistral': 814, 'n_tokens_neox': 794, 'n_words': 133}