<commit_before>-module(gproc).
-behaviour(gen_leader).

-include_lib("logging.hrl").

-export([start_link/0, start_link/1,
	 reg/2, unreg/1,
	 mreg/3,
	 set_value/2,
	 get_value/1,
	 update_counter/2,
	 send/2,
	 info/1, info/2,
	 select/1, select/2,
	 first/1,
	 next/2,
	 prev/2,
	 last/1,
	 table/1, table/2,
         where/1,
         name/1,
         name/2]).

-export([start_local/0, go_global/0, go_global/1]).

%%% internal exports
-export([init/1,
	 handle_cast/2,
	 handle_call/3,
	 handle_info/2,
	 handle_leader_call/4,
	 handle_leader_cast/3,
	 handle_DOWN/3,
	 elected/2,
	 surrendered/3,
	 from_leader/3,
	 code_change/4,
	 terminate/2]).

-define(TAB, ?MODULE).
-define(SERVER, ?MODULE).

-record(state, {mode, is_leader}).

start_local() ->
    create_tabs(),
    gen_leader:start(?SERVER, ?MODULE, [], [{debug, []}]).

go_global() ->
    ?INFO("calling go_global (Ns = ~p)~n", [[node()|nodes()]]),
    go_global([node()|nodes()]).

go_global(Nodes) when is_list(Nodes) ->
    ?INFO("calling go_global (Ns = ~p)~n", [Nodes]),
    case whereis(?SERVER) of
	undefined ->
	    start_link(Nodes);
	Pid ->
	    link(Pid),
	    ok = call({go_global, Nodes}),
	    {ok, Pid}
    end.

start_link() ->
    start_link([node()|nodes()]).

start_link(Nodes) ->
    create_tabs(),
    gen_leader:start_link(
      ?SERVER, Nodes, [],?MODULE, [], [{debug,[trace]}]).

where({n, C, _Name} = Key) when C==l; C==g ->
    case ets:lookup(?TAB, {Key, n}) of
        [{_, Pid, _}] ->
            Pid;
        [] -> undefined
    end.

name(Key) ->
    name(l, Key).
name(C, Key) when C==l;C==g ->
    {n, C, Key}.<commit_msg>Cutting down on the debug messages from gproc.<commit_after>-module(gproc).
-behaviour(gen_leader).

-include_lib("logging.hrl").

-export([start_link/0, start_link/1,
	 reg/2, unreg/1,
	 mreg/3,
	 set_value/2,
	 get_value/1,
	 update_counter/2,
	 send/2,
	 info/1, info/2,
	 select/1, select/2,
	 first/1,
	 next/2,
	 prev/2,
	 last/1,
	 table/1, table/2,
         where/1,
         name/1,
         name/2]).

-export([start_local/0, go_global/0, go_global/1]).

%%% internal exports
-export([init/1,
	 handle_cast/2,
	 handle_call/3,
	 handle_info/2,
	 handle_leader_call/4,
	 handle_leader_cast/3,
	 handle_DOWN/3,
	 elected/2,
	 surrendered/3,
	 from_leader/3,
	 code_change/4,
	 terminate/2]).

-define(TAB, ?MODULE).
-define(SERVER, ?MODULE).

-record(state, {mode, is_leader}).

start_local() ->
    create_tabs(),
    gen_leader:start(?SERVER, ?MODULE, [], []).

go_global() ->
    ?INFO("calling go_global (Ns = ~p)~n", [[node()|nodes()]]),
    go_global([node()|nodes()]).

go_global(Nodes) when is_list(Nodes) ->
    ?INFO("calling go_global (Ns = ~p)~n", [Nodes]),
    case whereis(?SERVER) of
	undefined ->
	    start_link(Nodes);
	Pid ->
	    link(Pid),
	    ok = call({go_global, Nodes}),
	    {ok, Pid}
    end.

start_link() ->
    start_link([node()|nodes()]).

start_link(Nodes) ->
    create_tabs(),
    gen_leader:start_link(
      ?SERVER, Nodes, [],?MODULE, [], []).

where({n, C, _Name} = Key) when C==l; C==g ->
    case ets:lookup(?TAB, {Key, n}) of
        [{_, Pid, _}] ->
            Pid;
        [] -> undefined
    end.

name(Key) ->
    name(l, Key).
name(C, Key) when C==l;C==g ->
    {n, C, Key}.
{'fraction_non_alphanumeric': 0.20368663594470046, 'fraction_numerical': 0.02273425499231951, 'mean_word_length': 2.8854415274463006, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, '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': '4066118', 'n_tokens_mistral': 1381, 'n_tokens_neox': 1285, 'n_words': 238}