Code for Project on Diversity-Stability Relationships