Simplifying create_prediction code and check origin resources
Cleaning after pep8 and pylint and some docs