Javascript Leap Year Function Python Syntax For Sorting