<commit_before>%% @author <NAME> <<EMAIL>>
%% @copyright 2013 <NAME>.
%% @doc Subscription.

-module(riak_pubsub_subscription).
-author('<NAME> <<EMAIL>>').

-behaviour(gen_server).

%% API
-export([start_link/2]).

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

-record(state, {channel, pid}).

%%%===================================================================
%%% API
%%%===================================================================

%%--------------------------------------------------------------------
%% @doc
%% Starts the server
%%
%% @spec start_link() -> {ok, Pid} | ignore | {error, Error}
%% @end
%%--------------------------------------------------------------------
start_link(Channel, Pid) ->
    gen_server:start_link({local, ?MODULE}, ?MODULE, [Channel, Pid], []).

%%%===================================================================
%%% gen_server callbacks
%%%===================================================================

%%--------------------------------------------------------------------
%% @private
%% @doc
%% Initializes the server
%%
%% @spec init(Args) -> {ok, State} |
%%                     {ok, State, Timeout} |
%%                     ignore |
%%                     {stop, Reason}
%% @end
%%--------------------------------------------------------------------<commit_msg>Generate unique subscription names.<commit_after>%% @author <NAME> <<EMAIL>>
%% @copyright 2013 <NAME>.
%% @doc Subscription.

-module(riak_pubsub_subscription).
-author('<NAME> <<EMAIL>>').

-behaviour(gen_server).

%% API
-export([start_link/2]).

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

-record(state, {channel, pid}).

%%%===================================================================
%%% API
%%%===================================================================

%%--------------------------------------------------------------------
%% @doc
%% Starts the server
%%
%% @spec start_link() -> {ok, Pid} | ignore | {error, Error}
%% @end
%%--------------------------------------------------------------------
start_link(Channel, Pid) ->
    Name = atom_to_list(?MODULE) ++ "_" ++ atom_to_list(Channel) ++ "_"
           ++ pid_to_list(Pid),
    gen_server:start_link({local, list_to_atom(Name)},
                          ?MODULE, [Channel, Pid], []).

%%%===================================================================
%%% gen_server callbacks
%%%===================================================================

%%--------------------------------------------------------------------
%% @private
%% @doc
%% Initializes the server
%%
%% @spec init(Args) -> {ok, State} |
%%                     {ok, State, Timeout} |
%%                     ignore |
%%                     {stop, Reason}
%% @end
%%--------------------------------------------------------------------
{'fraction_non_alphanumeric': 0.4876685300887866, 'fraction_numerical': 0.007234462347911871, 'mean_word_length': 1.7985280588776449, 'pattern_counts': {'":': 0, '<': 17, '<?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': '2209649', 'n_tokens_mistral': 758, 'n_tokens_neox': 716, 'n_words': 135}