Homogeneous polynomial

Convert a polynomial to homogeneous polynomial, modification including a new function and pyflakes.