def dup_inflate(f, m, K):
 if (m <= 0):
  raise IndexError(("'m' must be positive, got %s" % m))
 if ((m == 1) or (not f)):
  return f
 result = [f[0]]
 for coeff in f[1:]:
  result.extend(([K.zero] * (m - 1)))
  result.append(coeff)
 return result

def dup_inflate ( f , m , K ) : if ( m <= 0 ) : raise IndexError ( ( "'m' must be positive, got %s" % m ) ) if ( ( m == 1 ) or ( not f ) ) : return f result = [ f [ 0 ] ] for coeff in f [ 1 : ] : result . extend ( ( [ K . zero ] * ( m - 1 ) ) ) result . append ( coeff ) return result
map y to x**m in a polynomial in k[x] .