Revert "Remove encode.py"

This reverts commit 374f3fd019b710282ab50ac486d3ecd4c38791cc.
Added lsc