<commit_before>﻿using Akka.Actor;
using Akka.Interfaced;
using Akka.Interfaced.SlimSocket.Base;
using Akka.Interfaced.SlimSocket.Server;
using Common.Logging;
using HelloWorld.Interface;
using ProtoBuf.Meta;
using System;
using System.Net;
using System.Net.Sockets;
using TypeAlias;

namespace HelloWorld.Program.Server
{
    class Program
    {
        static void Main(string[] args)
        {
            if (typeof(IHelloWorld) == null)
                throw new Exception("Force interface module to be loaded");

            var system = ActorSystem.Create("MySystem");
            DeadRequestProcessingActor.Install(system);

            StartListen(system, 5000);

            Console.WriteLine("Please enter key to quit.");
            Console.ReadLine();
        }

        static TcpConnectionSettings _tcpConnectionSettings;

        static void StartListen(ActorSystem system, int port)
        {
            var logger = LogManager.GetLogger("ClientGateway");

            _tcpConnectionSettings = new TcpConnectionSettings
            {
                PacketSerializer = new PacketSerializer(
                    new PacketSerializerBase.Data(
                        new ProtoBufMessageSerializer(TypeModel.Create()),
                        new TypeAliasTable()))
            };

            var clientGateway = system.ActorOf(Props.Create(() => new ClientGateway(logger, CreateSession)));
            clientGateway.Tell(new ClientGatewayMessage.Start(new IPEndPoint(IPAddress.Any, port)));
        }

        static IActorRef CreateSession(IActorContext context, Socket socket)
        {
            var logger = LogManager.GetLogger($"Client({socket.RemoteEndPoint.ToString()})");
            return context.ActorOf(Props.Create(() => new ClientSession(
                logger, socket, _tcpConnectionSettings, CreateInitialActor)));
        }

        static Tuple<IActorRef, Type>[] CreateInitialActor(IActorContext context, Socket socket)
        {
            return new[]
            {
                Tuple.Create(context.ActorOf(Props.Create(() => new HelloWorldActor())),typeof(IHelloWorld))
            };
        }
    }
}<commit_msg>Cleanup code<commit_after>﻿using Akka.Actor;
using Akka.Interfaced;
using Akka.Interfaced.SlimSocket.Base;
using Akka.Interfaced.SlimSocket.Server;
using Common.Logging;
using HelloWorld.Interface;
using ProtoBuf.Meta;
using System;
using System.Net;
using System.Net.Sockets;
using TypeAlias;

namespace HelloWorld.Program.Server
{
    class Program
    {
        static TcpConnectionSettings _tcpConnectionSettings;

        static void Main(string[] args)
        {
            if (typeof(IHelloWorld) == null)
                throw new Exception("Force interface module to be loaded");

            var system = ActorSystem.Create("MySystem");
            DeadRequestProcessingActor.Install(system);

            StartListen(system, 5000);

            Console.WriteLine("Please enter key to quit.");
            Console.ReadLine();
        }

        static void StartListen(ActorSystem system, int port)
        {
            var logger = LogManager.GetLogger("ClientGateway");

            _tcpConnectionSettings = new TcpConnectionSettings
            {
                PacketSerializer = new PacketSerializer(
                    new PacketSerializerBase.Data(
                        new ProtoBufMessageSerializer(TypeModel.Create()),
                        new TypeAliasTable()))
            };

            var clientGateway = system.ActorOf(Props.Create(() => new ClientGateway(logger, CreateSession)));
            clientGateway.Tell(new ClientGatewayMessage.Start(new IPEndPoint(IPAddress.Any, port)));
        }

        static IActorRef CreateSession(IActorContext context, Socket socket)
        {
            var logger = LogManager.GetLogger($"Client({socket.RemoteEndPoint.ToString()})");
            return context.ActorOf(Props.Create(() => new ClientSession(
                logger, socket, _tcpConnectionSettings, CreateInitialActor)));
        }

        static Tuple<IActorRef, Type>[] CreateInitialActor(IActorContext context, Socket socket)
        {
            return new[]
            {
                Tuple.Create(context.ActorOf(Props.Create(() => new HelloWorldActor())),
                             typeof(IHelloWorld))
            };
        }
    }
}
{'fraction_non_alphanumeric': 0.09418791637950838, 'fraction_numerical': 0.001837813002526993, 'mean_word_length': 2.3185975609756095, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6335609', 'n_tokens_mistral': 1096, 'n_tokens_neox': 1054, 'n_words': 234}