def debug_assert(condition, msg=None):
 if (msg is None):
  msg = 'debug_assert failed'
 if (not condition):
  action = config.compute_test_value
  if (action in ['raise', 'ignore']):
   raise AssertionError(msg)
  else:
   assert (action == 'warn')
   warnings.warn(msg, stacklevel=2)

def debug_assert ( condition , msg = None ) : if ( msg is None ) : msg = 'debug_assert failed' if ( not condition ) : action = config . compute_test_value if ( action in [ 'raise' , 'ignore' ] ) : raise AssertionError ( msg ) else : assert ( action == 'warn' ) warnings . warn ( msg , stacklevel = 2 )
customized assert with options to ignore the assert with just a warning .