<commit_before>#!/usr/bin/env perl

use strict;
use warnings;

my $file = shift;

my %dataset = ();

open(FH, "<", $file) || die "Unable to open file '$file': $!";

close(FH) || die "Unable to close file '$file': $!";<commit_msg>Implementing the functionality<commit_after>#!/usr/bin/env perl

use strict;
use warnings;

my $file = shift;

my %dataset = ();

open(FH, "<", $file) || die "Unable to open file '$file': $!";

while (<FH>)
{
    my $tag = substr($_, 0, 2);

    $dataset{$tag} .= $_;
}

close(FH) || die "Unable to close file '$file': $!";

foreach my $tag (keys %dataset)
{
    my $file_tagged = $file.$tag;
    open(FH, ">", $file_tagged) || die "Unable to open file '$file_tagged': $!";
    print FH $dataset{$tag};
    close(FH) || die "Unable to close file '$file_tagged': $!";
}
{'fraction_non_alphanumeric': 0.21455457967377667, 'fraction_numerical': 0.002509410288582183, 'mean_word_length': 3.9565217391304346, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 5, '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': '4537023', 'n_tokens_mistral': 309, 'n_tokens_neox': 290, 'n_words': 88}