def assert_quantity_sub_equal(a, b, *attrs, **kwargs):
<EOL>if kwargs.pop('<STR_LIT>', False):<EOL><INDENT>assert_array = assert_allclose<EOL><DEDENT>else:<EOL><INDENT>assert_array = assert_array_equal<EOL><DEDENT>if not attrs:<EOL><INDENT>attrs = a._metadata_slots<EOL><DEDENT>exclude = kwargs.pop('<STR_LIT>', [])<EOL>attrs = [attr for attr in attrs if attr not in exclude]<EOL>assert_attributes(a, b, *attrs)<EOL>assert_array(a.value, b.value)<EOL>
Assert that two `~gwpy.types.Array` objects are the same (or almost)

    Parameters
    ----------
    a, b : `~gwpy.types.Array`
        the arrays two be tested (can be subclasses)

    *attrs
        the list of attributes to test, defaults to all

    almost_equal : `bool`, optional
        allow the numpy array's to be 'almost' equal, default: `False`,
        i.e. require exact matches

    exclude : `list`, optional
        a list of attributes to exclude from the test