<commit_before>class Inline::Perl5;

class Perl5Interpreter is repr('CPointer') { }

has Perl5Interpreter $!p5;
has Bool $!external_p5 = False;
has &!call_method;
has &!call_callable;

use nqp;
use NativeCall;

sub native(Sub $sub) {
    my $so = $*VM.config<dll>;
    $so ~~ s!^.*\%s!p5helper!;
    my $base = "lib/Inline/$so";
    state Str $path;
    unless $path {
        for @*INC {
            if my @files = ($_.files($base) || $_.files("blib/$base")) {
                my $files = @files[0]<files>;
                my $tmp = $files{$base} || $files{"blib/$base"};

                # copy to a temp dir
                #
                # This is required because CompUnitRepo::Local::Installation stores the file
                # with a different filename (a number with no extension) that NativeCall doesn't
                # know how to load. We do this copy to fix the filename.
                $path = $*SPEC.tmpdir ~ '/' ~ $*PID ~ '-' ~ $so;
                $tmp.IO.copy($path);
            }
        }
    }
    unless $path {
        die "unable to find Inline/$so IN \@*INC";
    }
    trait_mod:<is>($sub, :native($path));
}

class Perl5Object { ... }
class Perl5Callable { ... }

class ObjectKeeper {
    has @!objects;
    has $!last_free = -1;<commit_msg>Fix breakage caused by @*INC only containing Str<commit_after>class Inline::Perl5;

class Perl5Interpreter is repr('CPointer') { }

has Perl5Interpreter $!p5;
has Bool $!external_p5 = False;
has &!call_method;
has &!call_callable;

use nqp;
use NativeCall;

sub native(Sub $sub) {
    my $so = $*VM.config<dll>;
    $so ~~ s!^.*\%s!p5helper!;
    my $base = "lib/Inline/$so";
    state Str $path;
    unless $path {
        for @*INC {
            my $cur = $_ ~~ Str ?? INCLUDE-SPEC2CUR($_) !! $_;
            if my @files = ($cur.files($base) || $cur.files("blib/$base")) {
                my $files = @files[0]<files>;
                my $tmp = $files{$base} || $files{"blib/$base"};

                # copy to a temp dir
                #
                # This is required because CompUnitRepo::Local::Installation stores the file
                # with a different filename (a number with no extension) that NativeCall doesn't
                # know how to load. We do this copy to fix the filename.
                $path = $*SPEC.tmpdir ~ '/' ~ $*PID ~ '-' ~ $so;
                $tmp.IO.copy($path);
            }
        }
    }
    unless $path {
        die "unable to find Inline/$so IN \@*INC";
    }
    trait_mod:<is>($sub, :native($path));
}

class Perl5Object { ... }
class Perl5Callable { ... }

class ObjectKeeper {
    has @!objects;
    has $!last_free = -1;
{'fraction_non_alphanumeric': 0.1539909638554217, 'fraction_numerical': 0.007906626506024096, 'mean_word_length': 2.029646522234892, 'pattern_counts': {'":': 0, '<': 9, '<?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': '4292120', 'n_tokens_mistral': 915, 'n_tokens_neox': 875, 'n_words': 240}