def _check_ideal(self, J):
        """Helper to check ``J`` is an ideal of our ring."""
        if not isinstance(J, Ideal) or J.ring != self.ring:
            raise ValueError(
                'J must be an ideal of %s, got %s' % (self.ring, J))
dataset/ETHPy150Open sympy/sympy/sympy/polys/agca/ideals.py/Ideal._check_ideal/original