<commit_before># -*- test-case-name: go.apps.jsbox.tests.test_optout -*-
# -*- coding: utf-8 -*-

"""Resource for accessing and modifying a contact's opt-out/opt-in
   status from the sandbox"""

from twisted.internet.defer import inlineCallbacks, returnValue

from vumi.application.sandbox import SandboxResource


class OptoutException(Exception):
    pass


def optout_authorized(func):
    @inlineCallbacks
    def wrapper(self, api, command):
        if not (yield self.is_allowed(api)):
            returnValue(self.reply(
                command, success=False,
                reason='Account not allowed to manage optouts.'))<commit_msg>now really removing the exception<commit_after># -*- test-case-name: go.apps.jsbox.tests.test_optout -*-
# -*- coding: utf-8 -*-

"""Resource for accessing and modifying a contact's opt-out/opt-in
   status from the sandbox"""

from twisted.internet.defer import inlineCallbacks, returnValue

from vumi.application.sandbox import SandboxResource


def optout_authorized(func):
    @inlineCallbacks
    def wrapper(self, api, command):
        if not (yield self.is_allowed(api)):
            returnValue(self.reply(
                command, success=False,
                reason='Account not allowed to manage optouts.'))
{'fraction_non_alphanumeric': 0.10970797158642462, 'fraction_numerical': 0.0015785319652722968, 'mean_word_length': 3.2266666666666666, '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': '625668', 'n_tokens_mistral': 366, 'n_tokens_neox': 348, 'n_words': 98}