def _event_on_init(state, args, kwargs):
 instrumenting_mapper = state.manager.info.get(_INSTRUMENTOR)
 if instrumenting_mapper:
  if Mapper._new_mappers:
   configure_mappers()
  if instrumenting_mapper._set_polymorphic_identity:
   instrumenting_mapper._set_polymorphic_identity(state)

def _event_on_init ( state , args , kwargs ) : instrumenting_mapper = state . manager . info . get ( _INSTRUMENTOR ) if instrumenting_mapper : if Mapper . _new_mappers : configure_mappers ( ) if instrumenting_mapper . _set_polymorphic_identity : instrumenting_mapper . _set_polymorphic_identity ( state )
run init_instance hooks .