<commit_before># TODO: Temporal stripping

from __future__ import absolute_import

import datetime
import re
import xml.sax.saxutils

from .base import FieldSchema, Element
from flatland.util import (
    Unspecified,
    as_mapping,
    lazy_property,
    )
import flatland.exc as exc


__all__ = ('String', 'Integer', 'Long', 'Float', 'Boolean',
           'DateTime', 'Date', 'Time', 'Ref')


class _ScalarElement(Element):
    flattenable = True

    def __init__(self, schema, **kw):
        value = kw.pop('value', Unspecified)

        Element.__init__(self, schema, **kw)

        if value is not Unspecified:
            self.set(value)

    def set(self, value):
        """Assign the native and Unicode value.<commit_msg>Import cleanups.<commit_after># TODO: Temporal stripping
import datetime
import re
import flatland.exc as exc
from flatland.util import (
    Unspecified,
    as_mapping,
    lazy_property,
    )
from .base import FieldSchema, Element


__all__ = ('String', 'Integer', 'Long', 'Float', 'Boolean',
           'DateTime', 'Date', 'Time', 'Ref')

class _ScalarElement(Element):
    flattenable = True

    def __init__(self, schema, **kw):
        value = kw.pop('value', Unspecified)

        Element.__init__(self, schema, **kw)

        if value is not Unspecified:
            self.set(value)

    def set(self, value):
        """Assign the native and Unicode value.
{'fraction_non_alphanumeric': 0.11642857142857142, 'fraction_numerical': 0.0, 'mean_word_length': 3.1085043988269794, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, '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': '7189975', 'n_tokens_mistral': 429, 'n_tokens_neox': 409, 'n_words': 130}