Partition Functions and Automorphic Forms