'Remove useless generators from ``f``.
Returns the removed generators and the new excluded ``f``.
Examples
>>> from sympy.polys.polyclasses import DMP
>>> from sympy.polys.domains import ZZ
>>> DMP([[[ZZ(1)]], [[ZZ(1)], [ZZ(2)]]], ZZ).exclude()
([2], DMP([[1], [1, 2]], ZZ, None))'

def exclude(f):

    (J, F, u) = dmp_exclude(f.rep, f.lev, f.dom)
    return (J, f.__class__(F, f.dom, u))
