def array_assert(a, b, decimal=None, **kwargs):
    """Function checking whether two arrays are equal in size and almost_equal
    in content (using numpy.testing.assert_almost_equal).

    Parameters
    ----------
    a : ndarray
        First array to check
    b : ndarray
        Second array to check
    decimal : float
        The precisionof the comparison (Default value = None)
    **kwargs : dict
        Extra arguments to pass to numpy.testing.assert_almost_equal

    Returns
    -------

    """
    if decimal is None:
        if a.shape != b.shape:
            raise AssertionError("Sizes of matrices don't match (%s vs %s)" %
                (str(a.shape), str(b.shape)))
        if (a == b).all():
            return
        raise AssertionError(
            'Arrays are not the same:\nArray A:%s\nArray B:%s' % (a, b))
    else:
        from numpy.testing import assert_almost_equal
        assert_almost_equal(a, b, decimal, *kwargs)
