<commit_before>from .base import Module, extract_value


class AcceptRiskRules(Module):
	_name = "acccept_risk_rules"

	def init(self):
		return self._request('init')<commit_msg>added accept_risk_rules module<commit_after>from .base import Module, extract_value


class AcceptRiskRules(Module):
    _name = "accept_risk_rules"

    def init(self):
        return self._request('init')

    def get_rules(self, rep, plugin, port):
        """Returns risk rules

        :param rep: repID
        :param plugin: pluginID
        :param port: port number

        :return: returns risk rules

        """
        return self._request('getRules', {
            'repId': rep,
            'pluginID': plugin,
            'port': port
        })

    def add(self):
        #TODO: add
        raise NotImplementedError

    def delete(self, rules):
        """Deletes risk rules

        :param rules: acceptRiskRules

        :return
        """

        return self._request('delete', {
            'acceptRiskRules': rules
        })

    def apply(self, rep):
        """Applies specified changes to risk rules

        :param rep: redID

        :return: params
        """

        return self._request('apply', {
            'repID': rep
        })
{'fraction_non_alphanumeric': 0.10496794871794872, 'fraction_numerical': 0.0, 'mean_word_length': 2.0915841584158414, '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': '5387398', 'n_tokens_mistral': 364, 'n_tokens_neox': 337, 'n_words': 95}