Example code from the book Violent Python by TJ O'Connor