def _dup_decompose(f, K):
    df = len(f) - 1

    for s in range(2, df):
        if df % s != 0:
            continue

        h = _dup_right_decompose(f, s, K)

        if h is not None:
            g = _dup_left_decompose(f, h, K)

            if g is not None:
                return g, h

    return None
Helper function for :func:`dup_decompose`.
dataset/ETHPy150Open sympy/sympy/sympy/polys/densetools.py/_dup_decompose