<commit_before>%%% @doc Behavior for entities to use when added to a gen_event manager,
%%% and associated functions to fire events into a gen_event manager so
%%% a callback module can be used.
%%%
%%% The callback module detemines if a given entity_event is valuable or
%%% not. It is expected that most events will simple end up being a no-op.
%%%
%%% The state of an entity is persisted, and can be recovered.
%%% --------------------------------------------------------------------------------------------------------------------

-module(pre_gen_entity).

-callback init(Args :: list(any())) -> {'ok', any()}.
-callback simulate(Delta :: integer(), State :: any()) -> {'ok', any()}.
-callback handle_event(Name :: atom(), From :: 'undefined' | any(), To :: 'undefined' | any(), Data :: any(), State :: any()) -> {'ok', any()}.
-callback removed(Why :: any(), State :: any()) -> any().
-callback stopping(State :: any()) -> 'persist' | {'persist', any()} | 'ok'.

-type event_mgr_ref() :: pid() | atom() | {atom(), node()} | {'global', atom()} | {'via', atom(), atom()}.
-opaque timeout_msg() :: {'$pre_gen_entity_timer', any(), any(), any(), any()}.
-opaque notify_after_timer() :: {timeout_msg(), reference()}.<commit_msg>Added missing return from handle_event spec.<commit_after>%%% @doc Behavior for entities to use when added to a gen_event manager,
%%% and associated functions to fire events into a gen_event manager so
%%% a callback module can be used.
%%%
%%% The callback module detemines if a given entity_event is valuable or
%%% not. It is expected that most events will simple end up being a no-op.
%%%
%%% The state of an entity is persisted, and can be recovered.
%%% --------------------------------------------------------------------------------------------------------------------

-module(pre_gen_entity).

-callback init(Args :: list(any())) -> {'ok', any()}.
-callback simulate(Delta :: integer(), State :: any()) -> {'ok', any()}.
-callback handle_event(Name :: atom(), From :: 'undefined' | any(), To :: 'undefined' | any(), Data :: any(), State :: any()) -> {'ok', any()} | 'remove_entity'.
-callback removed(Why :: any(), State :: any()) -> any().
-callback stopping(State :: any()) -> 'persist' | {'persist', any()} | 'ok'.

-type event_mgr_ref() :: pid() | atom() | {atom(), node()} | {'global', atom()} | {'via', atom(), atom()}.
-opaque timeout_msg() :: {'$pre_gen_entity_timer', any(), any(), any(), any()}.
-opaque notify_after_timer() :: {timeout_msg(), reference()}.
{'fraction_non_alphanumeric': 0.2856003191065018, 'fraction_numerical': 0.0, 'mean_word_length': 2.974643423137876, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '3423788', 'n_tokens_mistral': 687, 'n_tokens_neox': 689, 'n_words': 263}