<commit_before>%%%-------------------------------------------------------------------
%% @copyright <NAME>
%% @author <NAME> <<EMAIL>>
%% @version {@vsn}, {@date} {@time}
%% @doc Simple IRC server.
%% @end
%%%-------------------------------------------------------------------
-module(simple_irc_server).

-behaviour(gen_irc_server).

-include_lib("logging.hrl").
-include_lib("eunit.hrl").
-include_lib("kernel/include/inet.hrl").

%% API
-export([start_link/0,
         start_link/3,
         shutdown/1]).

%% gen_irc_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
         terminate/2, code_change/3,
	 handle_nick/3]).

-record(state, {local_nicks = []}).

-define(SERVER, ?MODULE).
-define(PORT, 16667).

%%====================================================================
%% API
%%====================================================================
%%--------------------------------------------------------------------
%% @spec start_link() -> {ok,Pid} | ignore | {error,Error}
%% @doc Starts the server
%% @end
%%--------------------------------------------------------------------
start_link() ->
    start_link("localnet", atom_to_list(?MODULE), ?PORT).

start_link(Net, Name, Port) ->
    {ok, Pid} = gen_irc_server:start_link(?MODULE, Net, Name, []),
    {ok, _Listener} = gen_irc_server:listen(Pid, Port),
    {ok, Pid}.

shutdown(Server) ->
    gen_server:call(Server, shutdown).

%%====================================================================<commit_msg>simple_irc_server:start_link/0 now registers itself as ?MODULE.<commit_after>%%%-------------------------------------------------------------------
%% @copyright <NAME>
%% @author <NAME> <<EMAIL>>
%% @version {@vsn}, {@date} {@time}
%% @doc Simple IRC server.
%% @end
%%%-------------------------------------------------------------------
-module(simple_irc_server).

-behaviour(gen_irc_server).

-include_lib("logging.hrl").
-include_lib("eunit.hrl").
-include_lib("kernel/include/inet.hrl").

%% API
-export([start_link/0,
         start_link/3,
         shutdown/1]).

%% gen_irc_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
         terminate/2, code_change/3,
	 handle_nick/3]).

-record(state, {local_nicks = []}).

-define(SERVER, ?MODULE).
-define(PORT, 16667).

%%====================================================================
%% API
%%====================================================================
%%--------------------------------------------------------------------
%% @spec start_link() -> {ok,Pid} | ignore | {error,Error}
%% @doc Starts the server
%% @end
%%--------------------------------------------------------------------
start_link() ->
    {ok, Pid} = gen_irc_server:start_link({local, ?MODULE}, ?MODULE, "localnet", atom_to_list(?MODULE), []),
    {ok, _Listener} = gen_irc_server:listen(Pid, ?PORT),
    {ok, Pid}.

start_link(Net, Name, Port) ->
    {ok, Pid} = gen_irc_server:start_link(?MODULE, Net, Name, []),
    {ok, _Listener} = gen_irc_server:listen(Pid, Port),
    {ok, Pid}.

shutdown(Server) ->
    gen_server:call(Server, shutdown).

%%====================================================================
{'fraction_non_alphanumeric': 0.44267416432364887, 'fraction_numerical': 0.009684473601999375, 'mean_word_length': 2.304437564499484, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, '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': '3069630', 'n_tokens_mistral': 946, 'n_tokens_neox': 890, 'n_words': 157}