<commit_before>#LIBRARIES
from django.db.models.sql import compiler
# Following two ImportError blocks are for < 1.6 compatibility
try:
    from django.db.models.sql.compiler import SQLDateCompiler as DateCompiler
except ImportError:
    class DateCompiler(object):
        pass
try:
    from django.db.models.sql.compiler import SQLDateTimeCompiler as DateTimeCompiler
except ImportError:
    class DateTimeCompiler(object):
        pass

#DJANGAE
from .commands import (
    NewSelectCommand,
    InsertCommand,
    UpdateCommand,
    DeleteCommand
)

class SQLCompiler(compiler.SQLCompiler):
    def as_sql(self, with_limits=True, with_col_aliases=False, subquery=False):
        self.pre_sql_setup()
        self.refcounts_before = self.query.alias_refcount.copy()

        select = NewSelectCommand(
            self.connection,
            self.query
        )
        return (select, tuple())


class SQLInsertCompiler(compiler.SQLInsertCompiler, SQLCompiler):
    def __init__(self, *args, **kwargs):
        self.return_id = None
        super(SQLInsertCompiler, self).__init__(*args, **kwargs)

    def as_sql(self, with_limits=True, with_col_aliases=False, subquery=False):
        self.pre_sql_setup()

        from djangae.db.utils import get_concrete_fields

        # Always pass down all the fields on an insert
        return [ (InsertCommand(
            self.connection, self.query.model, self.query.objs,
            list(self.query.fields) + list(get_concrete_fields(self.query.model, ignore_leaf=True)),
            self.query.raw), tuple())
        ]


class SQLDeleteCompiler(compiler.SQLDeleteCompiler, SQLCompiler):
    def as_sql(self, with_limits=True, with_col_aliases=False, subquery=False):
        return (DeleteCommand(self.connection, self.query), tuple())


class SQLUpdateCompiler(compiler.SQLUpdateCompiler, SQLCompiler):

    def __init__(self, *args, **kwargs):
        super(SQLUpdateCompiler, self).__init__(*args, **kwargs)

    def as_sql(self, with_limits=True, with_col_aliases=False, subquery=False):
        self.pre_sql_setup()
        return (UpdateCommand(self.connection, self.query), tuple())


class SQLAggregateCompiler(compiler.SQLAggregateCompiler, SQLCompiler):
    pass


class SQLDateCompiler(DateCompiler, SQLCompiler):
    pass


class SQLDateTimeCompiler(DateTimeCompiler, SQLCompiler):
    pass<commit_msg>Just make all the newfangled Compilers pass through to SelectCompiler<commit_after>#LIBRARIES
from django.db.models.sql import compiler
# Following two ImportError blocks are for < 1.6 compatibility
try:
    from django.db.models.sql.compiler import SQLDateCompiler as DateCompiler
except ImportError:
    class DateCompiler(object):
        pass
try:
    from django.db.models.sql.compiler import SQLDateTimeCompiler as DateTimeCompiler
except ImportError:
    class DateTimeCompiler(object):
        pass

#DJANGAE
from .commands import (
    NewSelectCommand,
    InsertCommand,
    UpdateCommand,
    DeleteCommand
)

class SQLCompiler(compiler.SQLCompiler):
    def as_sql(self, with_limits=True, with_col_aliases=False, subquery=False):
        self.pre_sql_setup()
        self.refcounts_before = self.query.alias_refcount.copy()

        select = NewSelectCommand(
            self.connection,
            self.query
        )
        return (select, tuple())


class SQLInsertCompiler(compiler.SQLInsertCompiler, SQLCompiler):
    def __init__(self, *args, **kwargs):
        self.return_id = None
        super(SQLInsertCompiler, self).__init__(*args, **kwargs)

    def as_sql(self, with_limits=True, with_col_aliases=False, subquery=False):
        self.pre_sql_setup()

        from djangae.db.utils import get_concrete_fields

        # Always pass down all the fields on an insert
        return [ (InsertCommand(
            self.connection, self.query.model, self.query.objs,
            list(self.query.fields) + list(get_concrete_fields(self.query.model, ignore_leaf=True)),
            self.query.raw), tuple())
        ]


class SQLDeleteCompiler(compiler.SQLDeleteCompiler, SQLCompiler):
    def as_sql(self, with_limits=True, with_col_aliases=False, subquery=False):
        return (DeleteCommand(self.connection, self.query), tuple())


class SQLUpdateCompiler(compiler.SQLUpdateCompiler, SQLCompiler):

    def __init__(self, *args, **kwargs):
        super(SQLUpdateCompiler, self).__init__(*args, **kwargs)

    def as_sql(self, with_limits=True, with_col_aliases=False, subquery=False):
        self.pre_sql_setup()
        return (UpdateCommand(self.connection, self.query), tuple())


class SQLAggregateCompiler(compiler.SQLAggregateCompiler, SQLCompiler):
    def as_sql(self, with_limits=True, with_col_aliases=False, subquery=False):
        return SQLCompiler.as_sql(self, with_limits, with_col_aliases, subquery)


class SQLDateCompiler(DateCompiler, SQLCompiler):
    def as_sql(self, with_limits=True, with_col_aliases=False, subquery=False):
        return SQLCompiler.as_sql(self, with_limits, with_col_aliases, subquery)


class SQLDateTimeCompiler(DateTimeCompiler, SQLCompiler):
    def as_sql(self, with_limits=True, with_col_aliases=False, subquery=False):
        return SQLCompiler.as_sql(self, with_limits, with_col_aliases, subquery)
{'fraction_non_alphanumeric': 0.09390476190476191, 'fraction_numerical': 0.0007619047619047619, 'mean_word_length': 3.963137996219282, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4926740', 'n_tokens_mistral': 1536, 'n_tokens_neox': 1515, 'n_words': 329}