<commit_before>#! /usr/bin/env perl

use strict;
use warnings;

# Check arguments and print help function if needed
sub print_use {
    print "Usage: $0 PANDADEF SOURCE SOURCE ... OUTPUTHEAD\n\n";
    print "PANDADEF    Must be a PandaTree def file\n";
    print "SOURCE      Source file(s) that you would like to analyze\n";
    print "OUTPUTHEAD  Place where you would like to put the output header\n";
    return "\nYou did something wrong with arguments\n";
}
# Check presence of arguments
my $out_file = pop @ARGV or die print_use;
if (not @ARGV) {
    die print_use;
}

# Check that each source file exists
foreach my $fname (@ARGV) {
    if (not -e $fname) {
        print "File $fname does not exist!\n\n";
        die print_use;
    }
}

# Check first line of header
if (-e $out_file) {
    open (my $handle, '<', $out_file);
    chomp (my $first = <$handle>);
    close $handle;
    if ($first ne '#ifndef CROMBIE_FEEDPANDA_H') {
        print "First line of $out_file looks suspicious! I don't want to overwrite:\n";
        print "$first\n";
        die print_use;
    }
}

# Location of Panda definitions
my $def_file = shift @ARGV;
my @source;
my @branches = ('triggers');

foreach my $infile (@ARGV) {
    open (my $handle, '<', $infile);
    push @source, <$handle>;
    close $handle;
}

# Filter to get the members called
chomp(@source = grep { /\.|(->)/ } @source);

for (@source) {
    # Don't match with function members of event
    if (/event\.(\w+)(?!\w*\()/) {
        push @branches, $1;
    }<commit_msg>Don't include when 'event' is ending of another word<commit_after>#! /usr/bin/env perl

use strict;
use warnings;

# Check arguments and print help function if needed
sub print_use {
    print "Usage: $0 PANDADEF SOURCE SOURCE ... OUTPUTHEAD\n\n";
    print "PANDADEF    Must be a PandaTree def file\n";
    print "SOURCE      Source file(s) that you would like to analyze\n";
    print "OUTPUTHEAD  Place where you would like to put the output header\n";
    return "\nYou did something wrong with arguments\n";
}
# Check presence of arguments
my $out_file = pop @ARGV or die print_use;
if (not @ARGV) {
    die print_use;
}

# Check that each source file exists
foreach my $fname (@ARGV) {
    if (not -e $fname) {
        print "File $fname does not exist!\n\n";
        die print_use;
    }
}

# Check first line of header
if (-e $out_file) {
    open (my $handle, '<', $out_file);
    chomp (my $first = <$handle>);
    close $handle;
    if ($first ne '#ifndef CROMBIE_FEEDPANDA_H') {
        print "First line of $out_file looks suspicious! I don't want to overwrite:\n";
        print "$first\n";
        die print_use;
    }
}

# Location of Panda definitions
my $def_file = shift @ARGV;
my @source;
my @branches = ('triggers');

foreach my $infile (@ARGV) {
    open (my $handle, '<', $infile);
    push @source, <$handle>;
    close $handle;
}

# Filter to get the members called
chomp(@source = grep { /\.|(->)/ } @source);

for (@source) {
    # Don't match with function members of event
    if (/\bevent\.(\w+)(?!\w*\()/) {
        push @branches, $1;
    }
{'fraction_non_alphanumeric': 0.13599742184982275, 'fraction_numerical': 0.0012890750886239124, 'mean_word_length': 2.899497487437186, 'pattern_counts': {'":': 0, '<': 11, '<?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': '1960856', 'n_tokens_mistral': 1064, 'n_tokens_neox': 1048, 'n_words': 382}