The code I use at the Wikimedia foundation to crunch the numbers on fundraising tests.