<commit_before>"""
Created on 24 Sep 2016

@author: <NAME> (<EMAIL>)
"""

from datetime import date

from scs_core.data.localized_datetime import LocalizedDatetime


# --------------------------------------------------------------------------------------------------------------------

class Datum(object):
    """
    classdocs
    """
    
    # ----------------------------------------------------------------------------------------------------------------

    @staticmethod
    def float(number, ndigits):
        if number is None:
            return None

        try:
            value = float(number)
        except ValueError:
            return None

        return round(value, ndigits)


    @staticmethod
    def int(number):
        if number is None:
            return None

        try:
            value = float(number)
        except ValueError:
            return None

        return int(value)


    @staticmethod<commit_msg>Enabled bridge config modification.<commit_after>"""
Created on 24 Sep 2016

@author: <NAME> (<EMAIL>)
"""

from datetime import date

from scs_core.data.localized_datetime import LocalizedDatetime


# --------------------------------------------------------------------------------------------------------------------

class Datum(object):
    """
    classdocs
    """

    # ----------------------------------------------------------------------------------------------------------------

    @staticmethod
    def bool(field):
        if field is None:
            return None

        try:
            value = bool(field)
        except ValueError:
            return None

        return value


    @staticmethod
    def float(number, ndigits):
        if number is None:
            return None

        try:
            value = float(number)
        except ValueError:
            return None

        return round(value, ndigits)


    @staticmethod
    def int(number):
        if number is None:
            return None

        try:
            value = float(number)
        except ValueError:
            return None

        return int(value)


    @staticmethod
{'fraction_non_alphanumeric': 0.27328316086547505, 'fraction_numerical': 0.005644402634054563, 'mean_word_length': 0.9730983302411874, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5966205', 'n_tokens_mistral': 483, 'n_tokens_neox': 448, 'n_words': 138}