<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Drawing.Imaging;

namespace JPS
{
    class Program
    {
        /// <summary>
        /// Decodes a JPS file in jpeg images
        /// </summary>
        /// <remarks>
        /// A JPS file is a jpeg images containing the left and right channel images side-by-side. To decode, simply
        /// split the jpeg image in half and save each half as a jpeg file.
        /// </remarks>
        /// <param name="jpsFileName">The filename of the input .jps file</param>
        /// <param name="leftFileName">The filename of the output for the left channel image, 0.jpg by default</param>
        /// <param name="rightFileName">The filename of the output for the right channel image, 1.jpg by default</param>
        public static void DecodeJps(string jpsFileName, string leftFileName = "0.jpg", string rightFileName = "1.jpg")
        {
            // Read the input file, it will be loaded as a jpeg
            Image jpsFile = Image.FromFile(jpsFileName);

            // Create a bitmap that will hold the left half of the jps file
            using (Bitmap left = new Bitmap(jpsFile.Width / 2, jpsFile.Height))
            {
                // Draw the left half of the jps file onto the new bitmap
                using (Graphics g = Graphics.FromImage(left))
                {
                    g.DrawImage(jpsFile, new Rectangle(0, 0, left.Width, left.Height), new Rectangle(0, 0, left.Width, left.Height), GraphicsUnit.Pixel);
                }

                // Save the result as a jpeg
                left.Save(leftFileName, ImageFormat.Jpeg);
            }

            // Create a bitmap that will hold the right half of the jps file
            using (Bitmap right = new Bitmap(jpsFile.Width / 2, jpsFile.Height))
            {
                // Draw the right half of the jps file onto the new bitmap
                using (Graphics g = Graphics.FromImage(right))<commit_msg>Clenaed up JPS code to better conform to standards<commit_after>﻿using System.Drawing;
using System.Drawing.Imaging;

namespace JPS
{
    class Program
    {
        /// <summary>
        /// Decodes a JPS file in jpeg images
        /// </summary>
        /// <remarks>
        /// A JPS file is a jpeg images containing the left and right channel images side-by-side. To decode, simply
        /// split the jpeg image in half and save each half as a jpeg file.
        /// </remarks>
        /// <param name="jpsFileName">The filename of the input .jps file</param>
        /// <param name="leftFileName">The filename of the output for the left channel image, 0.jpg by default</param>
        /// <param name="rightFileName">The filename of the output for the right channel image, 1.jpg by default</param>
        public static void DecodeJps(string jpsFileName, string leftFileName = "0.jpg", string rightFileName = "1.jpg")
        {
            // Read the input file, it will be loaded as a jpeg
            var jpsFile = Image.FromFile(jpsFileName);

            // Create a bitmap that will hold the left half of the jps file
            using (var left = new Bitmap(jpsFile.Width / 2, jpsFile.Height))
            {
                // Draw the left half of the jps file onto the new bitmap
                using (var g = Graphics.FromImage(left))
                {
                    g.DrawImage(jpsFile, new Rectangle(0, 0, left.Width, left.Height), new Rectangle(0, 0, left.Width, left.Height), GraphicsUnit.Pixel);
                }

                // Save the result as a jpeg
                left.Save(leftFileName, ImageFormat.Jpeg);
            }

            // Create a bitmap that will hold the right half of the jps file
            using (var right = new Bitmap(jpsFile.Width / 2, jpsFile.Height))
            {
                // Draw the right half of the jps file onto the new bitmap
                using (var g = Graphics.FromImage(right))
{'fraction_non_alphanumeric': 0.09143142643017736, 'fraction_numerical': 0.004996252810392206, 'mean_word_length': 1.9162418062636561, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '2523008', 'n_tokens_mistral': 1086, 'n_tokens_neox': 1044, 'n_words': 423}