First complete version Python codes for Application 1