<commit_before>from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Auth import Auth, BootAuth
from PLC.Nodes import Node, Nodes
from PLC.Messages import Message, Messages

from PLC.Boot import notify_owners

class BootNotifyOwners(Method):
    """
    Notify the owners of the node, and/or support about an event that
    happened on the machine.

    Returns 1 if successful.
    """

    roles = ['node']

    accepts = [
        BootAuth(),
        Message.fields['message_id'],
        Parameter(int, "Notify PIs"),
        Parameter(int, "Notify technical contacts"),
        Parameter(int, "Notify support")
        ]

    returns = Parameter(int, '1 if successful')

    def call(self, auth, message_id, include_pis, include_techs, include_support):
        assert isinstance(self.caller, Node)
        notify_owners(self, self.caller, message_id, include_pis, include_techs, include_support)
        return 1<commit_msg>accept SessionAuth<commit_after>from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Auth import Auth, BootAuth
from PLC.Nodes import Node, Nodes
from PLC.Messages import Message, Messages

from PLC.Boot import notify_owners

class BootNotifyOwners(Method):
    """
    Notify the owners of the node, and/or support about an event that
    happened on the machine.

    Returns 1 if successful.
    """

    roles = ['node']

    accepts = [
        Mixed(BootAuth(), SessionAuth()),
        Message.fields['message_id'],
        Parameter(int, "Notify PIs"),
        Parameter(int, "Notify technical contacts"),
        Parameter(int, "Notify support")
        ]

    returns = Parameter(int, '1 if successful')

    def call(self, auth, message_id, include_pis, include_techs, include_support):
        assert isinstance(self.caller, Node)
        notify_owners(self, self.caller, message_id, include_pis, include_techs, include_support)
        return 1
{'fraction_non_alphanumeric': 0.09109624292331446, 'fraction_numerical': 0.003088008234688626, 'mean_word_length': 3.3685393258426966, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4127870', 'n_tokens_mistral': 553, 'n_tokens_neox': 532, 'n_words': 177}