def assert_numpy_array_equal(left, right, strict_nan=False,<EOL>check_dtype=True, err_msg=None,<EOL>check_same=None, obj='<STR_LIT>'):
__tracebackhide__ = True<EOL>assert_class_equal(left, right, obj=obj)<EOL>_check_isinstance(left, right, np.ndarray)<EOL>def _get_base(obj):<EOL><INDENT>return obj.base if getattr(obj, '<STR_LIT>', None) is not None else obj<EOL><DEDENT>left_base = _get_base(left)<EOL>right_base = _get_base(right)<EOL>if check_same == '<STR_LIT>':<EOL><INDENT>if left_base is not right_base:<EOL><INDENT>msg = "<STR_LIT>".format(<EOL>left=left_base, right=right_base)<EOL>raise AssertionError(msg)<EOL><DEDENT><DEDENT>elif check_same == '<STR_LIT>':<EOL><INDENT>if left_base is right_base:<EOL><INDENT>msg = "<STR_LIT>".format(<EOL>left=left_base, right=right_base)<EOL>raise AssertionError(msg)<EOL><DEDENT><DEDENT>def _raise(left, right, err_msg):<EOL><INDENT>if err_msg is None:<EOL><INDENT>if left.shape != right.shape:<EOL><INDENT>raise_assert_detail(obj, '<STR_LIT>'<EOL>.format(obj=obj), left.shape, right.shape)<EOL><DEDENT>diff = <NUM_LIT:0><EOL>for l, r in zip(left, right):<EOL><INDENT>if not array_equivalent(l, r, strict_nan=strict_nan):<EOL><INDENT>diff += <NUM_LIT:1><EOL><DEDENT><DEDENT>diff = diff * <NUM_LIT> / left.size<EOL>msg = '<STR_LIT>'.format(<EOL>obj=obj, pct=np.round(diff, <NUM_LIT:5>))<EOL>raise_assert_detail(obj, msg, left, right)<EOL><DEDENT>raise AssertionError(err_msg)<EOL><DEDENT>if not array_equivalent(left, right, strict_nan=strict_nan):<EOL><INDENT>_raise(left, right, err_msg)<EOL><DEDENT>if check_dtype:<EOL><INDENT>if isinstance(left, np.ndarray) and isinstance(right, np.ndarray):<EOL><INDENT>assert_attr_equal('<STR_LIT>', left, right, obj=obj)<EOL><DEDENT><DEDENT>return True<EOL>
Checks that 'np.ndarray' is equivalent

    Parameters
    ----------
    left : np.ndarray or iterable
    right : np.ndarray or iterable
    strict_nan : bool, default False
        If True, consider NaN and None to be different.
    check_dtype: bool, default True
        check dtype if both a and b are np.ndarray
    err_msg : str, default None
        If provided, used as assertion message
    check_same : None|'copy'|'same', default None
        Ensure left and right refer/do not refer to the same memory area
    obj : str, default 'numpy array'
        Specify object name being compared, internally used to show appropriate
        assertion message