<commit_before>'''
This module provides the ``Entity`` base class, as well as its metaclass
``EntityMeta``.
'''

from py23compat import sorted

import sys
import types
import warnings

from copy import deepcopy

import sqlalchemy
from sqlalchemy import Table, Column, Integer, desc, ForeignKey, and_, \
                       ForeignKeyConstraint
from sqlalchemy.orm import MapperExtension, mapper, object_session, \
                           EXT_CONTINUE, polymorphic_union, ScopedSession, \
                           ColumnProperty
from sqlalchemy.sql import ColumnCollection

import elixir
from elixir.statements import process_mutators, MUTATORS
from elixir import options
from elixir.properties import Property

DEBUG = False
try:
    from sqlalchemy.orm import EXT_PASS
    SA05orlater = False
except ImportError:
    SA05orlater = True

__doc_all__ = ['Entity', 'EntityMeta']


def session_mapper_factory(scoped_session):
    def session_mapper(cls, *args, **kwargs):
        if kwargs.pop('save_on_init', True):<commit_msg>modified elixir to work with latest version of sqlalchemy<commit_after>'''
This module provides the ``Entity`` base class, as well as its metaclass
``EntityMeta``.
'''

from py23compat import sorted

import sys
import types
import warnings

from copy import deepcopy

import sqlalchemy
from sqlalchemy import Table, Column, Integer, desc, ForeignKey, and_, \
                       ForeignKeyConstraint
from sqlalchemy.orm import MapperExtension, mapper, object_session, \
                           EXT_CONTINUE, polymorphic_union, \
                           ColumnProperty
#                           EXT_CONTINUE, polymorphic_union, ScopedSession, \
from sqlalchemy.orm import scoped_session as ScopedSession
from sqlalchemy.sql import ColumnCollection

import elixir
from elixir.statements import process_mutators, MUTATORS
from elixir import options
from elixir.properties import Property

DEBUG = False
try:
    from sqlalchemy.orm import EXT_PASS
    SA05orlater = False
except ImportError:
    SA05orlater = True

__doc_all__ = ['Entity', 'EntityMeta']


def session_mapper_factory(scoped_session):
    def session_mapper(cls, *args, **kwargs):
        if kwargs.pop('save_on_init', True):
{'fraction_non_alphanumeric': 0.06586021505376344, 'fraction_numerical': 0.005376344086021506, 'mean_word_length': 3.5664621676891617, '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': '3701861', 'n_tokens_mistral': 656, 'n_tokens_neox': 617, 'n_words': 203}