<commit_before>﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Mail;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace DoingTheDirty
{
    public class DetermineNightMessage
    {

        private string Carrier   
        {
            get
            {
                return ConfigurationManager.AppSettings["Carrier"];
            }
        }

        private string PhoneNumber
        {
            get
            {
                return ConfigurationManager.AppSettings["PhoneNumber"];
            }
        }

        private string FromAddress
        {
            get
            {
                return ConfigurationManager.AppSettings["FromAddress"];
            }
        }

        private string SmtpServer
        {
            get
            {
                return ConfigurationManager.AppSettings["SmtpServer"];
            }
        }

        private string SmtpPassword
        {
            get
            {
                return ConfigurationManager.AppSettings["SmtpPassword"];
            }
        }

        private int SmtpPort
        {
            get
            {
                return Convert.ToInt32(ConfigurationManager.AppSettings["SmtpPort"]);
            }
        }

        private string RandomOrgEndpoint
        {
            get
            {
                return ConfigurationManager.AppSettings["RandomOrgEndpoint"];
            }
        }

        private int SexThreshold
        {
            get
            {
                return Convert.ToInt32(ConfigurationManager.AppSettings["SexThreshold"]);
            }
        }

        private int AnalThreshold
        {
            get
            {
                return Convert.ToInt32(ConfigurationManager.AppSettings["AnalThreshold"]);
            }
        }

        public void Send()
        {
            try
            {
                var httpClient = new HttpClient();

                var requestMessage = new HttpRequestMessage()
                {
                    RequestUri = new Uri(RandomOrgEndpoint),
                    Method = new HttpMethod("POST"),
                };

                RandomNumberRequest request = new RandomNumberRequest
                {
                    Id = 12546,
                    Method = "generateIntegers",
                    JsonRpc = "2.0",
                    Params = new RandomNumberRequestParams
                    {
                        ApiKey = "00000000-0000-0000-0000-000000000000",
                        Base = 10,
                        Max = 1000,
                        Min = -1000,
                        N = 1,
                        Replacement = true
                    }
                };

                string requestContent = JsonConvert.SerializeObject(request);

                requestMessage.Content = new StringContent(requestContent);

                HttpResponseMessage responseMessage = Task.Run(() => httpClient.SendAsync(requestMessage)).Result;

                HttpContent content = responseMessage.Content;

                string randomOrgContent = Task.Run(() => content.ReadAsStringAsync()).Result;

                dynamic randomOrgResponse = JObject.Parse(randomOrgContent);

                int randomNumber = randomOrgResponse.result.random.data[0];

                string decision = "N";

                string anal = "N";

                if (randomNumber >= SexThreshold)
                {
                    decision = "Y";
                    anal = "N";
                }

                if (randomNumber >= AnalThreshold)
                {
                    decision = "Y";
                    anal = "Y";
                }

                string doTheDirtyMessage = string.Format("Number: {0} | Sex: {1} | Anal: {2}",
                    randomNumber, decision, anal);

                SmtpClient client = new SmtpClient(SmtpServer, SmtpPort)
                {
                    Credentials = new NetworkCredential(FromAddress, SmtpPassword),
                    EnableSsl = true
                };

                MailMessage message = new MailMessage
                {
                    Body = doTheDirtyMessage,
                    Subject = "Do the dirty",
                    IsBodyHtml = true,
                    From = new MailAddress(FromAddress),
                    To = { string.Format("{0}@{1}", PhoneNumber, Carrier)  }
                };

                client.Send(message);

            }
            catch (FormatException ex)
            {
                Console.WriteLine(ex.Message);
            }
            catch (SmtpException ex)
            {
                Console.WriteLine(ex.Message);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);<commit_msg>Remove undesired functionality<commit_after>﻿using System;
using System.Configuration;
using System.Net;
using System.Net.Http;
using System.Net.Mail;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace DoingTheDirty
{
    public class DetermineNightMessage
    {

        private string Carrier   
        {
            get
            {
                return ConfigurationManager.AppSettings["Carrier"];
            }
        }

        private string PhoneNumber
        {
            get
            {
                return ConfigurationManager.AppSettings["PhoneNumber"];
            }
        }

        private string FromAddress
        {
            get
            {
                return ConfigurationManager.AppSettings["FromAddress"];
            }
        }

        private string SmtpServer
        {
            get
            {
                return ConfigurationManager.AppSettings["SmtpServer"];
            }
        }

        private string SmtpPassword
        {
            get
            {
                return ConfigurationManager.AppSettings["SmtpPassword"];
            }
        }

        private int SmtpPort
        {
            get
            {
                return Convert.ToInt32(ConfigurationManager.AppSettings["SmtpPort"]);
            }
        }

        private string RandomOrgEndpoint
        {
            get
            {
                return ConfigurationManager.AppSettings["RandomOrgEndpoint"];
            }
        }

        private int SexThreshold
        {
            get
            {
                return Convert.ToInt32(ConfigurationManager.AppSettings["SexThreshold"]);
            }
        }

        public void Send()
        {
            try
            {
                var httpClient = new HttpClient();

                var requestMessage = new HttpRequestMessage()
                {
                    RequestUri = new Uri(RandomOrgEndpoint),
                    Method = new HttpMethod("POST"),
                };

                RandomNumberRequest request = new RandomNumberRequest
                {
                    Id = 12546,
                    Method = "generateIntegers",
                    JsonRpc = "2.0",
                    Params = new RandomNumberRequestParams
                    {
                        ApiKey = "00000000-0000-0000-0000-000000000000",
                        Base = 10,
                        Max = 1000,
                        Min = -1000,
                        N = 1,
                        Replacement = true
                    }
                };

                string requestContent = JsonConvert.SerializeObject(request);

                requestMessage.Content = new StringContent(requestContent);

                HttpResponseMessage responseMessage = Task.Run(() => httpClient.SendAsync(requestMessage)).Result;

                HttpContent content = responseMessage.Content;

                string randomOrgContent = Task.Run(() => content.ReadAsStringAsync()).Result;

                dynamic randomOrgResponse = JObject.Parse(randomOrgContent);

                int randomNumber = randomOrgResponse.result.random.data[0];

                string decision = "N";

                if (randomNumber >= SexThreshold)
                {
                    decision = "Y";
                }

                string doTheDirtyMessage = string.Format("Number: {0} | Sex: {1}",
                    randomNumber, decision);

                SmtpClient client = new SmtpClient(SmtpServer, SmtpPort)
                {
                    Credentials = new NetworkCredential(FromAddress, SmtpPassword),
                    EnableSsl = true
                };

                MailMessage message = new MailMessage
                {
                    Body = doTheDirtyMessage,
                    Subject = "Do the dirty",
                    IsBodyHtml = true,
                    From = new MailAddress(FromAddress),
                    To = { string.Format("{0}@{1}", PhoneNumber, Carrier)  }
                };

                client.Send(message);

            }
            catch (FormatException ex)
            {
                Console.WriteLine(ex.Message);
            }
            catch (SmtpException ex)
            {
                Console.WriteLine(ex.Message);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
{'fraction_non_alphanumeric': 0.07439244401995118, 'fraction_numerical': 0.012840921150376737, 'mean_word_length': 1.1384161561152712, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 3, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5995344', 'n_tokens_mistral': 2292, 'n_tokens_neox': 1989, 'n_words': 416}