<commit_before>package Mojolicious::Plugin::DefaultHelpers;
use Mojo::Base 'Mojolicious::Plugin';

use Mojo::ByteStream;
use Mojo::Collection;
use Mojo::Exception;
use Mojo::IOLoop;
use Mojo::Util qw(dumper sha1_sum steady_time);

sub register {
  my ($self, $app) = @_;

  # Controller alias helpers
  for my $name (qw(app flash param stash session url_for validation)) {
    $app->helper($name => sub { shift->$name(@_) });
  }

  # Stash key shortcuts (should not generate log messages)
  for my $name (qw(extends layout title)) {
    $app->helper(
      $name => sub {
        my $c = shift;
        $c->stash($name => shift, @_) if @_;
        return $c->stash->{$name};
      }
    );
  }

  $app->helper($_ => $self->can("_$_"))
    for qw(accepts content content_for csrf_token current_route delay),
    qw(inactivity_timeout is_fresh url_with);
  $app->helper(b => sub { shift; Mojo::ByteStream->new(@_) });
  $app->helper(c => sub { shift; Mojo::Collection->new(@_) });
  $app->helper(config            => sub { shift->app->config(@_) });
  $app->helper(dumper            => sub { shift; dumper(@_) });
  $app->helper(include           => sub { shift->render_to_string(@_) });
  $app->helper('reply.exception' => sub { _development('exception', @_) });
  $app->helper('reply.not_found' => sub { _development('not_found', @_) });<commit_msg>stash key shortcuts can be even simpler<commit_after>package Mojolicious::Plugin::DefaultHelpers;
use Mojo::Base 'Mojolicious::Plugin';

use Mojo::ByteStream;
use Mojo::Collection;
use Mojo::Exception;
use Mojo::IOLoop;
use Mojo::Util qw(dumper sha1_sum steady_time);

sub register {
  my ($self, $app) = @_;

  # Controller alias helpers
  for my $name (qw(app flash param stash session url_for validation)) {
    $app->helper($name => sub { shift->$name(@_) });
  }

  # Stash key shortcuts (should not generate log messages)
  for my $name (qw(extends layout title)) {
    $app->helper($name => sub { shift->stash($name, @_) });
  }

  $app->helper($_ => $self->can("_$_"))
    for qw(accepts content content_for csrf_token current_route delay),
    qw(inactivity_timeout is_fresh url_with);
  $app->helper(b => sub { shift; Mojo::ByteStream->new(@_) });
  $app->helper(c => sub { shift; Mojo::Collection->new(@_) });
  $app->helper(config            => sub { shift->app->config(@_) });
  $app->helper(dumper            => sub { shift; dumper(@_) });
  $app->helper(include           => sub { shift->render_to_string(@_) });
  $app->helper('reply.exception' => sub { _development('exception', @_) });
  $app->helper('reply.not_found' => sub { _development('not_found', @_) });
{'fraction_non_alphanumeric': 0.18600228223659185, 'fraction_numerical': 0.0007607455306200076, 'mean_word_length': 3.9716446124763705, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 62, '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': '4656145', 'n_tokens_mistral': 888, 'n_tokens_neox': 876, 'n_words': 198}