This is a copy of Dwork et al's supplementary code for the paper The reusable holdout: Preserving validity in adaptive data analysis. It was originally hosted here.
I've also written a short blogpost on the ideas involved.
Disclaimer: This is in no way my research. I've hosted it here because it provides syntax highlighting and it makes it easy for people to fork.