<commit_before>"""
Col -- SQLObject columns

Note that each column object is named BlahBlahCol, and these are used
in class definitions.  But there's also a corresponding SOBlahBlahCol
object, which is used in SQLObject *classes*.

An explanation: when a SQLObject subclass is created, the metaclass
looks through your class definition for any subclasses of Col.  It
collects them together, and indexes them to do all the database stuff
you like, like the magic attributes and whatnot.  It then asks the Col
object to create an SOCol object (usually a subclass, actually).  The
SOCol object contains all the interesting logic, as well as a record
of the attribute name you used and the class it is bound to (set by
the metaclass).

So, in summary: Col objects are what you define, but SOCol objects
are what gets used.
"""

import re, time
try:
    import cPickle as pickle
except ImportError:
    import pickle
import sqlbuilder
# Sadly the name "constraints" conflicts with many of the function
# arguments in this module, so we rename it:
import constraints as consts
from include import validators

NoDefault = sqlbuilder.NoDefault
True, False = 1==1, 0==1

try:
    import datetime
except ImportError: # Python 2.2
    datetime_available = False
else:
    datetime_available = True

try:
    from mx import DateTime
except ImportError:
    try:
        import DateTime # old version of mxDateTime
    except ImportError:
        mxdatetime_available = False
    else:
        mxdatetime_available = True
else:
    mxdatetime_available = True

if datetime_available:
    DATETIME_IMPLEMENTATION = "datetime"

if mxdatetime_available:
    MXDATETIME_IMPLEMENTATION = "mxDateTime"
    DateTimeType = type(DateTime.now())

if datetime_available:
    default_datetime_implementation = DATETIME_IMPLEMENTATION
elif mxdatetime_available:
    default_datetime_implementation = MXDATETIME_IMPLEMENTATION<commit_msg>Handle case where datetime isn't defined (it will result in a NameError otherwise, as there's a test against DATETIME_IMPLEMENTATION which  isn't defined if datetime isn't importable)<commit_after>"""
Col -- SQLObject columns

Note that each column object is named BlahBlahCol, and these are used
in class definitions.  But there's also a corresponding SOBlahBlahCol
object, which is used in SQLObject *classes*.

An explanation: when a SQLObject subclass is created, the metaclass
looks through your class definition for any subclasses of Col.  It
collects them together, and indexes them to do all the database stuff
you like, like the magic attributes and whatnot.  It then asks the Col
object to create an SOCol object (usually a subclass, actually).  The
SOCol object contains all the interesting logic, as well as a record
of the attribute name you used and the class it is bound to (set by
the metaclass).

So, in summary: Col objects are what you define, but SOCol objects
are what gets used.
"""

import re, time
try:
    import cPickle as pickle
except ImportError:
    import pickle
import sqlbuilder
# Sadly the name "constraints" conflicts with many of the function
# arguments in this module, so we rename it:
import constraints as consts
from include import validators

NoDefault = sqlbuilder.NoDefault
True, False = 1==1, 0==1

try:
    import datetime
except ImportError: # Python 2.2
    datetime_available = False
else:
    datetime_available = True

try:
    from mx import DateTime
except ImportError:
    try:
        import DateTime # old version of mxDateTime
    except ImportError:
        mxdatetime_available = False
    else:
        mxdatetime_available = True
else:
    mxdatetime_available = True

DATETIME_IMPLEMENTATION = "datetime"
MXDATETIME_IMPLEMENTATION = "mxDateTime"

if mxdatetime_available:
    DateTimeType = type(DateTime.now())

if datetime_available:
    default_datetime_implementation = DATETIME_IMPLEMENTATION
elif mxdatetime_available:
    default_datetime_implementation = MXDATETIME_IMPLEMENTATION
{'fraction_non_alphanumeric': 0.046452915930320623, 'fraction_numerical': 0.003029537995455693, 'mean_word_length': 4.361299052774019, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1498533', 'n_tokens_mistral': 1079, 'n_tokens_neox': 1058, 'n_words': 490}