<commit_before># encoding: utf-8

"""
.. codeauthor:: <NAME> <<EMAIL>>
"""

from __future__ import absolute_import
from __future__ import unicode_literals

from decimal import (
    Decimal,
    InvalidOperation,
)

from .._const import StrictLevel
from .._error import TypeConversionError
from ._interface import AbstractValueConverter


class IntegerConverter(AbstractValueConverter):

    def force_convert(self):
        try:
            return int(Decimal(self._value))
        except (TypeError, OverflowError, ValueError, InvalidOperation):
            raise TypeConversionError(
                "failed to force_convert to int: type={}".format(
                    type(self._value)))<commit_msg>Remove un unused import<commit_after># encoding: utf-8

"""
.. codeauthor:: <NAME> <<EMAIL>>
"""

from __future__ import absolute_import
from __future__ import unicode_literals

from decimal import (
    Decimal,
    InvalidOperation,
)

from .._error import TypeConversionError
from ._interface import AbstractValueConverter


class IntegerConverter(AbstractValueConverter):

    def force_convert(self):
        try:
            return int(Decimal(self._value))
        except (TypeError, OverflowError, ValueError, InvalidOperation):
            raise TypeConversionError(
                "failed to force_convert to int: type={}".format(
                    type(self._value)))
{'fraction_non_alphanumeric': 0.08953068592057761, 'fraction_numerical': 0.001444043321299639, 'mean_word_length': 3.3043478260869565, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '3685697', 'n_tokens_mistral': 367, 'n_tokens_neox': 356, 'n_words': 102}