fx "ddlmZdZdZdZy))MeTTact|dk(r)t|dk(rt|dr |dfd}|S|jddfd}|S)zReturns a decorator for registering the results of a method. The behavior of the decorator depends on whether it is used with or without arguments.rc"|yN) run_contextfuncmethods T/var/lib/jenkins/workspace/mettalog/venv/lib/python3.12/site-packages/hyperon/ext.pymetta_registerz(register_results..metta_register s ; ' pass_mettaFcfd}|S)NcVr|jn}||yr)metta)r regsr r rs r r z7register_results..inner..metta_registers&4>tK--/0DF{D)rr)r r r rs` r innerzregister_results..inners * " !r)lencallableget)r argskwargsr rr rs` @@r register_resultsrsZ  4yA~#f+*xQ/@Aw ( ZZ e4  " rc"d}t|||S)a/Function decorator which registers returned pairs of regular expressions and atoms in a Tokenizer using the RunContext.register_atom() method. Parameters ---------- pass_metta: Pass instance of MeTTa class to the decorated function as an argument. Default is False. cX|jD]\}}|j||yr)items register_atom)r rrexatoms r register_atoms_internalz/register_atoms..register_atoms_internal*s&IC  % %c4 0&rr)rrr!s r register_atomsr# s1 3T6 BBrc"d}t|||S)aBFunction decorator which registers returned pairs of regular expressions and lambdas in a Tokenizer using the RunContext.register_token() method. Parameters ---------- pass_metta : bool, optional Pass instance of MeTTa class to the decorated function as an argument. Default is False. cX|jD]\}}|j||yr)rregister_token)r rrlams r register_tokens_internalz1register_tokens..register_tokens_internal9s& HC  & &sC 0%rr")rrr(s r register_tokensr)/s1 4dF CCrN)runnerrrr#r)rrr r+s: C Dr