def METHOD_NAME(self, ref, x, abs_eps=1e-12, rel_eps=1e-6, msg=None):
    """
    Fail if the two complex objects are unequal as determined by both
    absolute delta (abs_eps) and relative delta (rel_eps).
    """
    if abs(ref - x) < abs_eps:
        return
    if abs(ref) > abs_eps:
        if abs(ref - x) / abs(ref) > rel_eps:
            raise self.failureException(
                msg or '%r != %r rel_error = %r rel_limit = %r' % (
                    ref, x, abs(ref - x) / abs(ref), rel_eps
                )
            )
    else:
        raise self.failureException(
            msg or '%r != %r rel_error = %r rel_limit = %r' % (
                ref, x, abs(ref - x) / abs(ref), rel_eps
            )
        )