python cookbook example