How To Improve Performance Of Python Code