Python code by the book ProgrammingCollectiveIntelligence. This is just for study.