<commit_before>use MooseX::Declare;

use 5.010;

class Artemis::MCP::Scheduler::OfficialQueues {

        use aliased 'Artemis::MCP::Scheduler::Queue';
        use aliased 'Artemis::MCP::Scheduler::PreconditionProducer';
        use Artemis::Model 'model';

        has queuelist => (is     => 'ro',
                         isa     => 'HashRef['.Queue.']',
                         default => sub { &load_queuelist },
                        );

        # XXX TODO: create these lists from hardware db

        sub load_queuelist
        {
                no strict 'refs';
                my $queue_rs = model('TestrunDB')->resultset('Queue')->search({});
                my %queues;
                foreach ($queue_rs->all) {
                        my %producer;
                        if ($_->producer) {
                                my $producer_class = "Artemis::MCP::Scheduler::PreconditionProducer::".$_->producer;
                                eval "use $producer_class";
                                %producer = (producer => $producer_class->new ) unless $@;
                        }
                        $queues{$_->name} = Queue->new ( name     => $_->name,
                                                         priority => $_->priority,
                                                         %producer,<commit_msg>Scheduler: tack queue id in object<commit_after>use MooseX::Declare;

use 5.010;

class Artemis::MCP::Scheduler::OfficialQueues {

        use aliased 'Artemis::MCP::Scheduler::Queue';
        use aliased 'Artemis::MCP::Scheduler::PreconditionProducer';
        use Artemis::Model 'model';

        has queuelist => (is     => 'ro',
                         isa     => 'HashRef['.Queue.']',
                         default => sub { &load_queuelist },
                        );

        # XXX TODO: create these lists from hardware db

        sub load_queuelist
        {
                no strict 'refs';
                my $queue_rs = model('TestrunDB')->resultset('Queue')->search({});
                my %queues;
                foreach ($queue_rs->all) {
                        my %producer;
                        if ($_->producer) {
                                my $producer_class = "Artemis::MCP::Scheduler::PreconditionProducer::".$_->producer;
                                eval "use $producer_class";
                                %producer = (producer => $producer_class->new ) unless $@;
                        }
                        $queues{$_->name} = Queue->new ( id       => $_->id,
                                                         name     => $_->name,
                                                         priority => $_->priority,
                                                         %producer,
{'fraction_non_alphanumeric': 0.12007168458781362, 'fraction_numerical': 0.002867383512544803, 'mean_word_length': 1.1289092295957284, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4369686', 'n_tokens_mistral': 712, 'n_tokens_neox': 655, 'n_words': 136}