<commit_before># -*- coding: utf-8 -*-
"""
molvs.validations
~~~~~~~~~~~~~~~~~



:copyright: Copyright 2014 by <NAME>.
:license: MIT, see LICENSE file for more details.
"""

from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
import logging

from rdkit import Chem

from .errors import StopValidateError
from .fragment import REMOVE_FRAGMENTS


class Validation(object):
    """The base class that all Validations must inherit from."""

    def __init__(self, log):
        self.log = logging.LoggerAdapter(log, {'validation': type(self).__name__})

    def __call__(self, mol):
        try:
            self.log.debug('Running %s', type(self).__name__)
            self.run(mol)
        except Exception as e:
            if isinstance(e, StopValidateError):
                raise e
            else:
                self.log.error('Validation failed: %s', e)

    def run(self, mol):
        """"""
        raise NotImplementedError("Validation subclasses must implement the run method")

<commit_msg>Validation failure should be debug level<commit_after># -*- coding: utf-8 -*-
"""
molvs.validations
~~~~~~~~~~~~~~~~~



:copyright: Copyright 2014 by <NAME>.
:license: MIT, see LICENSE file for more details.
"""

from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
import logging

from rdkit import Chem

from .errors import StopValidateError
from .fragment import REMOVE_FRAGMENTS


class Validation(object):
    """The base class that all Validations must inherit from."""

    def __init__(self, log):
        self.log = logging.LoggerAdapter(log, {'validation': type(self).__name__})

    def __call__(self, mol):
        try:
            self.log.debug('Running %s', type(self).__name__)
            self.run(mol)
        except Exception as e:
            if isinstance(e, StopValidateError):
                raise e
            else:
                self.log.debug('Validation failed: %s', e)

    def run(self, mol):
        """"""
        raise NotImplementedError("Validation subclasses must implement the run method")


{'fraction_non_alphanumeric': 0.11436541143654114, 'fraction_numerical': 0.004649000464900047, 'mean_word_length': 2.9558823529411766, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3583973', 'n_tokens_mistral': 604, 'n_tokens_neox': 574, 'n_words': 193}