Code samples from the "Python Cookbook, 3rd Edition", published by O'Reilly & Associates, May, 2013.