Source: https://web.archive.org/web/20041206021225if_/http://www.twistedmatrix.com/users/z3p/files/pyvm2.py