<commit_before>﻿using Discord;
using Discord.Commands;
using Discord.Modules;
using System;
using System.Collections.Specialized;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading.Tasks;

namespace DiscordBot.Modules.Waifu2x
{
    internal class Waifu2xModule : IModule
    {
        private ModuleManager _manager;
        private DiscordClient _client;
        private HttpService _http;

        void IModule.Install(ModuleManager manager)
        {
            _manager = manager;
            _client = manager.Client;
            _http = _client.GetService<HttpService>();

            manager.CreateCommands("", group =>
            {
                group.CreateCommand("waifu2x")
                .Alias("w2x")
                .Description("Uploads image to waifu2x and returns it.\nIf no additional Parameters are specified, the default Values will be used `Noise: None` and `Amount 1x`")
                .Parameter("image url", ParameterType.Required)
                .Parameter("amount", ParameterType.Optional)
                .Parameter("noise", ParameterType.Optional)
                .Do(async e =>
                {
                    int scale = 2;
                    int amount = 1;
                    Noise noise = Noise.None;

                    if (e.Args[1] != "")
                    {
                        int.TryParse(e.Args[1], out amount);
                    }

                    if (amount > 3)
                    {
                        await _client.ReplyError(e, "Max Amount is 3... Aborting.");
                        return;
                    }
                    if (amount == 0)
                    {
                        await _client.ReplyError(e, "So you want to upscale `0` times huh?");
                        return;
                    }

                    if (e.Args[2] != "")<commit_msg>no wait this is better<commit_after>﻿using Discord;
using Discord.Commands;
using Discord.Modules;
using System;
using System.Collections.Specialized;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading.Tasks;

namespace DiscordBot.Modules.Waifu2x
{
    internal class Waifu2xModule : IModule
    {
        private ModuleManager _manager;
        private DiscordClient _client;
        private HttpService _http;

        void IModule.Install(ModuleManager manager)
        {
            _manager = manager;
            _client = manager.Client;
            _http = _client.GetService<HttpService>();

            manager.CreateCommands("", group =>
            {
                group.CreateCommand("waifu2x")
                .Alias("w2x")
                .Description("Uploads image to waifu2x and returns it.\nIf no additional Parameters are specified, the default Values will be used `Noise: None` and `Amount 1x`")
                .Parameter("image url", ParameterType.Required)
                .Parameter("amount", ParameterType.Optional)
                .Parameter("noise", ParameterType.Optional)
                .Do(async e =>
                {
                    int scale = 2;
                    int amount = 1;
                    Noise noise = Noise.None;

                    if (e.Args[1] != "")
                    {
                        int.TryParse(e.Args[1], out amount);
                    }

                    if (amount > 3)
                    {
                        await _client.ReplyError(e, "Max Amount is 3... Aborting.");
                        return;
                    }
                    if (amount <= 0)
                    {
                        await _client.ReplyError(e, $"So you want to upscale `{amount}` times huh?");
                        return;
                    }

                    if (e.Args[2] != "")
{'fraction_non_alphanumeric': 0.09186076943208585, 'fraction_numerical': 0.007589636220884585, 'mean_word_length': 1.3607164916615195, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 11, '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': '407052', 'n_tokens_mistral': 1001, 'n_tokens_neox': 933, 'n_words': 246}