# Path: hecatoncheir/exception.py
# class ValidationError(Exception):
#     source = None
# 
#     def __init__(self, value, rule, params=None, source=None):
#         self.value = value
#         self.rule = rule
#         self.params = params
#         self.source = source
# 
#     def __str__(self):
#         return self.value
# 
# Path: hecatoncheir/msgutil.py
# class DbProfilerJSONEncoder(json.JSONEncoder):
#     def default(self, o):
# def jsonize(data):


import re
import RecordValidator
from hecatoncheir.exception import ValidationError
from hecatoncheir.msgutil import gettext as _
            True on evaluation succeeded, otherwise False.
        """
        # self.rule: [ column name, format ]
        assert len(self.rule) == 2
        assert len(column_names) == len(record)

        self.statistics[0] += 1

        kv = {}
        for k, v in zip(column_names, record):
            # if the value is not a number, it needs to be quoted with "'".
            try:
                float(v)
                kv[k] = v
            except ValueError as e:
                kv[k] = "'" + v + "'"
        try:
            s = self.rule[1].format(**kv)
        except KeyError as e:
            self.statistics[1] += 1
            raise ValidationError(
                _("Parameter error: ") + "`%s'" % kv,
                self.rule)

        try:
            if eval(s) is False:
                self.statistics[1] += 1
                return False
        except SyntaxError:
            self.statistics[1] += 1

# Path: hecatoncheir/exception.py
# class ValidationError(Exception):
#     source = None
# 
#     def __init__(self, value, rule, params=None, source=None):
#         self.value = value
#         self.rule = rule
#         self.params = params
#         self.source = source
# 
#     def __str__(self):
#         return self.value
# 
# Path: hecatoncheir/msgutil.py
# class DbProfilerJSONEncoder(json.JSONEncoder):
#     def default(self, o):
# def jsonize(data):


# Path: hecatoncheir/validator/EvalValidator.py
import re
import RecordValidator
from hecatoncheir.exception import ValidationError
from hecatoncheir.msgutil import gettext as _

            True on evaluation succeeded, otherwise False.
        """
        # self.rule: [ column name, format ]
        assert len(self.rule) == 2
        assert len(column_names) == len(record)

        self.statistics[0] += 1

        kv = {}
        for k, v in zip(column_names, record):
            # if the value is not a number, it needs to be quoted with "'".
            try:
                float(v)
                kv[k] = v
            except ValueError as e:
                kv[k] = "'" + v + "'"
        try:
            s = self.rule[1].format(**kv)
        except KeyError as e:
            self.statistics[1] += 1
            raise ValidationError(
                _("Parameter error: ") + "`%s'" % kv,
                self.rule)

        try:
            if eval(s) is False:
                self.statistics[1] += 1
                return False
        except SyntaxError:
            self.statistics[1] += 1

            raise ValidationError(