(f, g)
Invert ``f`` modulo ``g``, if possible.
Invert ``f`` modulo ``g``, if possible.
Invert f modulo g if possible .
def invert(f, g):
        """Invert ``f`` modulo ``g``, if possible. """
        lev, dom, per, F, G = f.unify(g)

        if not lev:
            return per(dup_invert(F, G, dom))
        else:
            raise ValueError('univariate polynomial expected')
def invert ( f , g ) : lev , dom , per , F , G = f . unify ( g ) if not lev : return per ( dup_invert ( F , G , dom ) ) else : raise ValueError ( 'univariate polynomial expected' )