Python Set Time Limit On Function In Js