def dup_content(f, K):
    from sympy.polys.domains import QQ

    if not f:
        return K.zero

    cont = K.zero

    if K == QQ:
        for c in f:
            cont = K.gcd(cont, c)
    else:
        for c in f:
            cont = K.gcd(cont, c)

            if K.is_one(cont):
                break

    return cont
Compute the GCD of coefficients of ``f`` in ``K[x]``.
dataset/ETHPy150Open sympy/sympy/sympy/polys/densetools.py/dup_content