def dup_invert(f, g, K):
    s, h = dup_half_gcdex(f, g, K)

    if h == [K.one]:
        return dup_rem(s, g, K)
    else:
        raise NotInvertible("zero divisor")
Test category variations
dataset/ETHPy150Open sympy/sympy/sympy/polys/euclidtools.py/dup_invert--crossover with--dataset/ETHPy150Open pyvideo/steve/tests/test_utils.py/TestVerifyVideoData.test_category