<commit_before>%%%-------------------------------------------------------------------
%%% File    : sample_srv.erl
%%% Description : 
%%% @hidden
%%% Created :  5 Jun 2010 by <NAME> <<EMAIL>>
%%%-------------------------------------------------------------------
-module(sample_srv).

-include_lib("eunit/include/eunit.hrl").

%% rpc methods
-export([hello/0, add/2, send_notify/2]).

%% API
-export([init/1, handle_call/3, terminate/2, code_change/3]).

-record(state, {}).
%%====================================================================
%% API
%%====================================================================
init(_Argv)->
    {ok, #state{}}.

hello()->
    {reply, "hello, msgpack!"}.

add(I, J) when is_integer(I) andalso is_integer(J)->
%    ?debugVal({I,J}),
    {reply, I+J}.

send_notify(Num,BinPid) when is_integer(Num) andalso Num > 0 andalso is_binary(BinPid) ->
    ?debugVal(binary_to_term(BinPid)),
    gen_msgpack_rpc_srv:notify(get_notify, [BinPid]),
    {reply, ok}.

handle_call(_Request, _From, State)->
    Reply=ok,
    {reply, Reply, State}.

terminate(_Reason, State)->
    {ok, State}.

code_change(_OldVsn, State, _Extra) ->
    {ok, State}.

%%====================================================================
%% Internal functions
%%====================================================================<commit_msg>bugfix: use *got*, not get.<commit_after>%%%-------------------------------------------------------------------
%%% File    : sample_srv.erl
%%% Description : 
%%% @hidden
%%% Created :  5 Jun 2010 by <NAME> <<EMAIL>>
%%%-------------------------------------------------------------------
-module(sample_srv).

-include_lib("eunit/include/eunit.hrl").

%% rpc methods
-export([hello/0, add/2, send_notify/2]).

%% API
-export([init/1, handle_call/3, terminate/2, code_change/3]).

-record(state, {}).
%%====================================================================
%% API
%%====================================================================
init(_Argv)->
    {ok, #state{}}.

hello()->
    {reply, "hello, msgpack!"}.

add(I, J) when is_integer(I) andalso is_integer(J)->
%    ?debugVal({I,J}),
    {reply, I+J}.

send_notify(Num,BinPid) when is_integer(Num) andalso Num > 0 andalso is_binary(BinPid) ->
    Pid = self(),
    gen_msgpack_rpc_srv:notify(Pid, got_notify, [BinPid]),
    {reply, ok}.

handle_call(_Request, _From, State)->
    Reply=ok,
    {reply, Reply, State}.

terminate(_Reason, State)->
    {ok, State}.

code_change(_OldVsn, State, _Extra) ->
    {ok, State}.

%%====================================================================
%% Internal functions
%%====================================================================
{'fraction_non_alphanumeric': 0.44575645756457566, 'fraction_numerical': 0.00959409594095941, 'mean_word_length': 3.164362519201229, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 25, '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': '6469543', 'n_tokens_mistral': 825, 'n_tokens_neox': 776, 'n_words': 152}