(F, p, K)
return g
Expand results of :func:`factor` in ``GF(p)[x]``.

    Examples
    ========

    >>> from sympy.polys.domains import ZZ
    >>> from sympy.polys.galoistools import gf_expand

    >>> gf_expand([([3, 2, 4], 1), ([2, 2], 2), ([3, 1], 3)], 5, ZZ)
    [4, 3, 0, 3, 0, 1, 4, 1]
Expand results of :func:`factor` in ``GF(p)[x]``.
Expand results of : func : factor in GF ( p ) [ x ] .
def gf_expand(F, p, K):
    """
    Expand results of :func:`factor` in ``GF(p)[x]``.

    Examples
    ========

    >>> from sympy.polys.domains import ZZ
    >>> from sympy.polys.galoistools import gf_expand

    >>> gf_expand([([3, 2, 4], 1), ([2, 2], 2), ([3, 1], 3)], 5, ZZ)
    [4, 3, 0, 3, 0, 1, 4, 1]

    """
    if type(F) is tuple:
        lc, F = F
    else:
        lc = K.one

    g = [lc]

    for f, k in F:
        f = gf_pow(f, k, p, K)
        g = gf_mul(g, f, p, K)

    return g
def gf_expand ( F , p , K ) : if type ( F ) is tuple : lc , F = F else : lc = K . one g = [ lc ] for f , k in F : f = gf_pow ( f , k , p , K ) g = gf_mul ( g , f , p , K ) return g