def test_optimized_passes(self):

        base, sub = self.tables.base, self.tables.sub


        class Base(fixtures.ComparableEntity):
            pass
        class Sub(Base):
            pass

        mapper(Base, base, polymorphic_on=base.c.type, polymorphic_identity='base')

        # redefine Sub's "id" to favor the "id" col in the subtable.
        # "id" is also part of the primary join condition
        mapper(Sub, sub, inherits=Base,
                        polymorphic_identity='sub',
                        properties={'id':[sub.c.id, base.c.id]})
        sess = sessionmaker()()
        s1 = Sub(data='s1data', sub='s1sub')
        sess.add(s1)
        sess.commit()
        sess.expunge_all()

        # load s1 via Base.  s1.id won't populate since it's relative to
        # the "sub" table.  The optimized load kicks in and tries to
        # generate on the primary join, but cannot since "id" is itself unloaded.
        # the optimized load needs to return "None" so regular full-row loading proceeds
        s1 = sess.query(Base).first()
        assert s1.sub == 's1sub'
write a post-function decorator to replace a rendering
dataset/ETHPy150Open zzzeek/sqlalchemy/test/orm/inheritance/test_basic.py/OptimizedLoadTest.test_optimized_passes--crossover with--dataset/ETHPy150Open RoseOu/flasky/venv/lib/python2.7/site-packages/mako/codegen.py/_GenerateRenderMethod.write_cache_decorator