def nan_close(first_array, second_array, rtol=<NUM_LIT>, atol=<NUM_LIT>, equal_nan=True):
<EOL>if first_array.shape != second_array.shape:<EOL><INDENT>return False<EOL><DEDENT>if (first_array.dtype.names is None and second_array.dtype.names is not None) or (first_array.dtype.names is not None and second_array.dtype.names is None):<EOL><INDENT>return False<EOL><DEDENT>if first_array.dtype.names is None:  <EOL><INDENT>if first_array.dtype != second_array.dtype:<EOL><INDENT>return False<EOL><DEDENT>return np.allclose(a=first_array, b=second_array, rtol=rtol, atol=atol, equal_nan=equal_nan)<EOL><DEDENT>else:<EOL><INDENT>if first_array.dtype.names != second_array.dtype.names:<EOL><INDENT>return False<EOL><DEDENT>for column in first_array.dtype.names:<EOL><INDENT>if first_array[column].dtype != second_array[column].dtype:<EOL><INDENT>return False<EOL><DEDENT>if not np.allclose(a=first_array[column], b=second_array[column], rtol=rtol, atol=atol, equal_nan=equal_nan):<EOL><INDENT>return False<EOL><DEDENT><DEDENT>return True<EOL><DEDENT>
Compares two arrays and test for similarity.

    Works with recarrays.

    Parameters
    ----------
    first_array : numpy.ndarray
    second_array : numpy.ndarray
    rtol : float
    atol : float
    equal_nan : boolean
        If True, NaNs are considered equal.

    Returns
    -------
    boolean