<commit_before>use v6;

module File::Find;

sub checkrules ($elem, %opts) {
    if %opts<name>.defined {
        if %opts<name> ~~ Str {
            return False unless $elem.basename ~~ %opts<name>
        } else {
            return False unless $elem ~~ %opts<name>
        }
    }
    if %opts<type>.defined {
        given %opts<type> {
            when 'dir' {
                return False unless $elem ~~ :d
            }
            when 'file' {
                return False unless $elem ~~ :f
            }
            when 'symlink' {
                return False unless $elem ~~ :l
            }
            default {
                die "type attribute has to be dir, file or symlink";
            }
        }
    }
    return True
}<commit_msg>Squashed 'ext/File__Find/' changes from 19250d2..a2e1797<commit_after>use v6;

unit module File::Find;

sub checkrules ($elem, %opts) {
    if %opts<name>.defined {
        if %opts<name> ~~ Str {
            return False unless $elem.basename ~~ %opts<name>
        } else {
            return False unless $elem ~~ %opts<name>
        }
    }
    if %opts<type>.defined {
        given %opts<type> {
            when 'dir' {
                return False unless $elem ~~ :d
            }
            when 'file' {
                return False unless $elem ~~ :f
            }
            when 'symlink' {
                return False unless $elem ~~ :l
            }
            default {
                die "type attribute has to be dir, file or symlink";
            }
        }
    }
    return True
}
{'fraction_non_alphanumeric': 0.10997442455242967, 'fraction_numerical': 0.008312020460358057, 'mean_word_length': 1.2947214076246334, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '1018957', 'n_tokens_mistral': 451, 'n_tokens_neox': 448, 'n_words': 129}