fix flake8 violations
fix built-in function mismatch between 2 to 3
update codes to python 3 compatible
Merge pull request #6 from shkumagai/master

apply python 3.x support