'Check if ``poly`` belongs the ideal generated by ``self``.
Examples
>>> from sympy import groebner
>>> from sympy.abc import x, y
>>> f = 2*x**3 + y**3 + 3*y
>>> G = groebner([x**2 + y**2 - 1, x*y - 2])
>>> G.contains(f)
True
>>> G.contains(f + 1)
False'

def contains(self, poly):

    return (self.reduce(poly)[1] == 0)
