<commit_before>__ALL__ = [
            'INT', 'CHAR', 'VARCHAR', 'TEXT', 'FLOAT', 'DECIMAL', 
            'TIMESTAMP', 'DATETIME', 'CLOB', 'BLOB', 'BOOLEAN', 'String', 'Integer', 'Numeric', 'DateTime', 'Binary', 'Boolean'
            ]


class TypeEngineMeta(type):
    typeself = property(lambda cls:cls.singleton)        
    typeclass = property(lambda cls: cls)
    
class TypeEngine(object):
    __metaclass__ = TypeEngineMeta
    def get_col_spec(self, typeobj):
        raise NotImplementedError()
    def convert_bind_param(self, value):
        raise NotImplementedError()
    def convert_result_value(self, value):
        raise NotImplementedError()
    def adapt(self, typeobj):
        return typeobj()

    typeclass = property(lambda s: s.__class__)
    typeself = property(lambda s:s)
    
class NullTypeEngine(TypeEngine):
    def get_col_spec(self, typeobj):
        raise NotImplementedError()
    def convert_bind_param(self, value):
        return value
    def convert_result_value(self, value):
        return value

class String(TypeEngine):
    def __init__(self, length):
        self.length = length
    def adapt(self, typeobj):
        return typeobj(self.length)
String.singleton = String(-1)

class Integer(TypeEngine):
    """integer datatype"""
    pass
Integer.singleton = Integer()

class Numeric(TypeEngine):
    def __init__(self, precision, length):
        self.precision = precision
        self.length = length
    def adapt(self, typeobj):<commit_msg>more work on the types...<commit_after>__ALL__ = [
            'INT', 'CHAR', 'VARCHAR', 'TEXT', 'FLOAT', 'DECIMAL', 
            'TIMESTAMP', 'DATETIME', 'CLOB', 'BLOB', 'BOOLEAN', 'String', 'Integer', 'Numeric', 'DateTime', 'Binary', 'Boolean'
            ]


class TypeEngineMeta(type):
    typeself = property(lambda cls:cls.singleton)        
    typeclass = property(lambda cls: cls)
    
class TypeEngine(object):
    __metaclass__ = TypeEngineMeta
    def get_col_spec(self, typeobj):
        raise NotImplementedError()
    def convert_bind_param(self, value):
        raise NotImplementedError()
    def convert_result_value(self, value):
        raise NotImplementedError()
    def adapt(self, typeobj):
        return typeobj()
    def type_descriptor(self, conversion, cls = None):
        t = cls or self.__class__
        for t in t.__mro__[0:-1]:
            try:
                return self.adapt(conversion[t])
            except KeyError, e:
                pass
        return self.adapt(cls or self.__class__)

    typeclass = property(lambda s: s.__class__)
    typeself = property(lambda s:s)
    
class NullTypeEngine(TypeEngine):
    def get_col_spec(self, typeobj):
        raise NotImplementedError()
    def convert_bind_param(self, value):
        return value
    def convert_result_value(self, value):
        return value

class String(TypeEngine):
    def __init__(self, length):
        self.length = length
    def adapt(self, typeobj):
        return typeobj(self.length)
    def type_descriptor(self, conversion):
        if self.length is None:
            return super(String, self).type_descriptor(conversion, TEXT)
        else:
            return super(String, self).type_descriptor(conversion)
            
String.singleton = String(-1)

class Integer(TypeEngine):
    """integer datatype"""
    pass
Integer.singleton = Integer()

class Numeric(TypeEngine):
    def __init__(self, precision, length):
        self.precision = precision
        self.length = length
    def adapt(self, typeobj):
{'fraction_non_alphanumeric': 0.11129991503823279, 'fraction_numerical': 0.0011328235627301047, 'mean_word_length': 2.9200887902330743, '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': '4517934', 'n_tokens_mistral': 1036, 'n_tokens_neox': 1030, 'n_words': 260}