def prepare_instrumentation(factory):
 if (factory in __canned_instrumentation):
  factory = __canned_instrumentation[factory]
 cls = type(factory())
 if (cls in __canned_instrumentation):
  factory = __converting_factory(cls, factory)
  cls = factory()
 if __instrumentation_mutex.acquire():
  try:
   if (getattr(cls, '_sa_instrumented', None) != id(cls)):
    _instrument_class(cls)
  finally:
   __instrumentation_mutex.release()
 return factory

def prepare_instrumentation ( factory ) : if ( factory in __canned_instrumentation ) : factory = __canned_instrumentation [ factory ] cls = type ( factory ( ) ) if ( cls in __canned_instrumentation ) : factory = __converting_factory ( cls , factory ) cls = factory ( ) if __instrumentation_mutex . acquire ( ) : try : if ( getattr ( cls , '_sa_instrumented' , None ) != id ( cls ) ) : _instrument_class ( cls ) finally : __instrumentation_mutex . release ( ) return factory
prepare a callable for future use as a collection class factory .