from checkio_referee import RefereeBase
from checkio_referee.validators import BaseValidator, ValidationError

import settings
import settings_env
from tests import TESTS

PRECISION = 0.001


class SuperRootValidator(BaseValidator):
    def validate(self, outer_result):
        if not isinstance(outer_result, (int, float)):
            self.additional_data = "The result should be a float or an integer."
            raise ValidationError
        if abs(outer_result) > 12:
            raise ValidationError
        p = outer_result ** outer_result
        self.additional_data = p
        if abs(self._test["input"] - p) >= PRECISION:
            raise ValidationError


class Referee(RefereeBase):
    TESTS = TESTS
    EXECUTABLE_PATH = settings.EXECUTABLE_PATH
    CURRENT_ENV = settings_env.CURRENT_ENV
    FUNCTION_NAME = "super_root"
    VALIDATOR = SuperRootValidator

@@ -57,27 +57,16 @@
 eree
-.validators
  import 
 Base
@@ -61,29 +61,25 @@
  import 
-BaseV
+v
 alidator
 , Valida
@@ -74,25 +74,9 @@
 ator
-, ValidationError
+s
 %0A%0Aim
@@ -153,16 +153,53 @@
  0.001%0A%0A
+Result = validators.ValidatorResult%0A%0A
 %0Aclass S
@@ -216,16 +216,27 @@
 lidator(
+validators.
 BaseVali
@@ -348,38 +348,36 @@
         
-self.additional_data =
+return Result(False,
  %22The re
@@ -418,42 +418,9 @@
 er.%22
-%0A            raise ValidationError
+)
 %0A   
@@ -464,36 +464,35 @@
        r
-aise ValidationError
+eturn Result(False)
 %0A       
@@ -629,28 +629,27 @@
    r
-aise ValidationError
+eturn Result(False)
 %0A%0A%0Ac

fix validator