Python Code For Maximum Likelihood Estimation