def _maybe_real(A, B, tol=None):
 if (np.isrealobj(A) and np.iscomplexobj(B)):
  if (tol is None):
   tol = {0: (feps * 1000.0), 1: (eps * 1000000.0)}[_array_precision[B.dtype.char]]
  if np.allclose(B.imag, 0.0, atol=tol):
   B = B.real
 return B

def _maybe_real ( A , B , tol = None ) : if ( np . isrealobj ( A ) and np . iscomplexobj ( B ) ) : if ( tol is None ) : tol = { 0 : ( feps * 1000.0 ) , 1 : ( eps * 1000000.0 ) } [ _array_precision [ B . dtype . char ] ] if np . allclose ( B . imag , 0.0 , atol = tol ) : B = B . real return B
return either b or the real part of b .