The Energy Level Density and Partition Function of Nuclei