<commit_before>package DBIx::Class::Schema::Config;
use 5.005;
use warnings;
use strict;
use base 'DBIx::Class::Schema';
use Data::Dumper;

our $VERSION = '0.001001'; # 0.1.1
$VERSION = eval $VERSION;


sub connection {
    my ( $class, @info ) = @_;

    my $config = $class->_make_config( @info );
    
    $config = $class->load_credentials( $config )
        unless $config->{dsn} =~ /^dbi:/;
    
    return $class->next::method( $config );
    return $class->next::method(
        $config->{dsn},
        $config->{user},
        $config->{password},
        $config->{options},
    );
}

# Normalize arrays into hashes, so we have only one form
# to work with later.
sub _make_config {
    my ( $class, $dsn, $user, $pass, $dbi_attr, $extra_attr ) = @_;
    return $dsn if ref $dsn eq 'HASH';

    my %connection = ( dsn => $dsn, user => $user, password => $pass );

    return { %connection, %$dbi_attr, %$extra_attr} if $extra_attr;
    return { %connection, %$dbi_attr } if $dbi_attr;
    return { %connection };
}

sub load_credentials {
    my ( $class, $config ) = @_;
    require Config::Any;

    return $config if $config->{dsn} =~ /^dbi:/i;

    # TODO This block is ugly, make it prettier.
    my $ConfigAny = Config::Any->load_stems( { stems => $class->config_paths, use_ext => 1 } );

    for my $cfile ( @$ConfigAny ) {
        my ($filename) = keys %$cfile;
        for my $database ( keys %{$cfile->{$filename}} ) {<commit_msg>Removed extra return statemnet not the that first works.<commit_after>package DBIx::Class::Schema::Config;
use 5.005;
use warnings;
use strict;
use base 'DBIx::Class::Schema';
use Data::Dumper;

our $VERSION = '0.001001'; # 0.1.1
$VERSION = eval $VERSION;


sub connection {
    my ( $class, @info ) = @_;

    my $config = $class->_make_config( @info );
    
    $config = $class->load_credentials( $config )
        unless $config->{dsn} =~ /^dbi:/;
    
    return $class->next::method( $config );
}

# Normalize arrays into hashes, so we have only one form
# to work with later.
sub _make_config {
    my ( $class, $dsn, $user, $pass, $dbi_attr, $extra_attr ) = @_;
    return $dsn if ref $dsn eq 'HASH';

    my %connection = ( dsn => $dsn, user => $user, password => $<PASSWORD> );

    return { %connection, %$dbi_attr, %$extra_attr} if $extra_attr;
    return { %connection, %$dbi_attr } if $dbi_attr;
    return { %connection };
}

sub load_credentials {
    my ( $class, $config ) = @_;
    require Config::Any;

    return $config if $config->{dsn} =~ /^dbi:/i;

    # TODO This block is ugly, make it prettier.
    my $ConfigAny = Config::Any->load_stems( { stems => $class->config_paths, use_ext => 1 } );

    for my $cfile ( @$ConfigAny ) {
        my ($filename) = keys %$cfile;
        for my $database ( keys %{$cfile->{$filename}} ) {
{'fraction_non_alphanumeric': 0.17231537638244737, 'fraction_numerical': 0.010702818408847663, 'mean_word_length': 3.123529411764706, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 35, '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': '6516503', 'n_tokens_mistral': 1029, 'n_tokens_neox': 989, 'n_words': 272}