def _wrap_result(result, is_complex, shape=None):
 if is_complex:
  z = _real2complex(result)
 else:
  z = result
 if (shape is not None):
  z = z.reshape(shape)
 return z

def _wrap_result ( result , is_complex , shape = None ) : if is_complex : z = _real2complex ( result ) else : z = result if ( shape is not None ) : z = z . reshape ( shape ) return z
wrap op result to have correct dtype .