<commit_before>class Any is also {
    multi method first(Code $test) {
        return $_ if $test($_) for @.list;

        fail('No values matched');
    }

    our List multi method grep(Code $test) {
        gather {
            take $_ if $test($_) for @.list;
        }
    }

    our List multi method map(Code *&expr) {
        return gather {
            my $arity = &expr.arity || 1;
            my @args;
            for @.list {
                @args.push($_);
                if (@args == $arity) {
                    take &expr(|@args);
                    @args = ();
                }
            }
        }
    }

     # RT #63700 - parse failed on &infix:<cmp>
    multi method min( $values: Code $by = sub { $^a cmp $^b } ) {
         my @list = $values.list;
         return +Inf unless @list.elems;
         my $res = @list.shift;
         for @list -> $x {
             if (&$by($res, $x) > 0) {
                 $res = $x;
             }
         }
         $res;
     };


    our List multi method pairs(*@indices) is export {
        gather {
            if @indices {
                for (@.list.keys Z @.list) -> $key, $val is rw {
                    take ($key => $val) if $key ~~ any(@indices);
                }
            } else {
                for (@.list.keys Z @.list) -> $key, $val is rw {
                    take ($key => $val)
                }
            }
        }
    }

    multi method reduce( Code $expression is rw) {
        my Int $arity = $expression.count;
        fail('Cannot reduce() using a unary or nullary function.')<commit_msg>Remove Code type from parameter with & sigil - that would mean something Callable that returns Code. Also a stray space that I spotted should go.<commit_after>class Any is also {
    multi method first(Code $test) {
        return $_ if $test($_) for @.list;

        fail('No values matched');
    }

    our List multi method grep(Code $test) {
        gather {
            take $_ if $test($_) for @.list;
        }
    }

    our List multi method map(*&expr) {
        return gather {
            my $arity = &expr.arity || 1;
            my @args;
            for @.list {
                @args.push($_);
                if (@args == $arity) {
                    take &expr(|@args);
                    @args = ();
                }
            }
        }
    }

     # RT #63700 - parse failed on &infix:<cmp>
    multi method min( $values: Code $by = sub { $^a cmp $^b } ) {
         my @list = $values.list;
         return +Inf unless @list.elems;
         my $res = @list.shift;
         for @list -> $x {
             if (&$by($res, $x) > 0) {
                 $res = $x;
             }
         }
         $res;
     };


    our List multi method pairs(*@indices) is export {
        gather {
            if @indices {
                for (@.list.keys Z @.list) -> $key, $val is rw {
                    take ($key => $val) if $key ~~ any(@indices);
                }
            } else {
                for (@.list.keys Z @.list) -> $key, $val is rw {
                    take ($key => $val)
                }
            }
        }
    }

    multi method reduce(Code $expression is rw) {
        my Int $arity = $expression.count;
        fail('Cannot reduce() using a unary or nullary function.')
{'fraction_non_alphanumeric': 0.13353474320241693, 'fraction_numerical': 0.004229607250755287, 'mean_word_length': 1.1941683233929754, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '3065499', 'n_tokens_mistral': 996, 'n_tokens_neox': 947, 'n_words': 304}