Implementation of the McCarthy 91 function in python