def is_managed(using=None):
 if (using is None):
  using = DEFAULT_DB_ALIAS
 thread_ident = thread.get_ident()
 if ((thread_ident in state) and (using in state[thread_ident])):
  if state[thread_ident][using]:
   return state[thread_ident][using][(-1)]
 return settings.TRANSACTIONS_MANAGED

def is_managed ( using = None ) : if ( using is None ) : using = DEFAULT_DB_ALIAS thread_ident = thread . get_ident ( ) if ( ( thread_ident in state ) and ( using in state [ thread_ident ] ) ) : if state [ thread_ident ] [ using ] : return state [ thread_ident ] [ using ] [ ( - 1 ) ] return settings . TRANSACTIONS_MANAGED
checks whether the transaction manager is in manual or in auto state .