def METHOD_NAME(e):
    return (
        # Newer error message (numpy >= 1.16.0).
        "elementwise comparison failed" in str(e)
        # Older error messages.
        or "elementwise == comparison failed" in str(e)
        or "elementwise != comparison failed" in str(e)
    )