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

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
expand results of :func:factor in gf(p)[x] .