<commit_before># Copyright (c) 2012, <NAME>
package API::Base::UserCommands;

use warnings;
use strict;
use v5.10;

use utils 'log2';

use Scalar::Util 'looks_like_number';

sub register_user_command {
    my ($mod, %opts) = @_;

    # make sure all required options are present
    foreach my $what (qw|name description code|) {
        next if exists $opts{$what};
        $opts{name} ||= 'unknown';
        log2("user command $opts{name} does not have '$what' option.");
        return
    }
    
    $mod->{user_commands} ||= [];
    my $CODE       = $opts{code};<commit_msg>import col()<commit_after># Copyright (c) 2012, <NAME>
package API::Base::UserCommands;

use warnings;
use strict;
use v5.10;

use utils qw(log2 col);

use Scalar::Util 'looks_like_number';

sub register_user_command {
    my ($mod, %opts) = @_;

    # make sure all required options are present
    foreach my $what (qw|name description code|) {
        next if exists $opts{$what};
        $opts{name} ||= 'unknown';
        log2("user command $opts{name} does not have '$what' option.");
        return
    }
    
    $mod->{user_commands} ||= [];
    my $CODE       = $opts{code};
{'fraction_non_alphanumeric': 0.14961306964746346, 'fraction_numerical': 0.015477214101461736, 'mean_word_length': 3.1130742049469964, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '7193199', 'n_tokens_mistral': 394, 'n_tokens_neox': 385, 'n_words': 113}