def legal_date(year, month, day):
try:<EOL><INDENT>assert year >= <NUM_LIT:1><EOL>assert <NUM_LIT:0> < month <= <NUM_LIT><EOL>assert <NUM_LIT:0> < day <= <NUM_LIT><EOL>if month == <NUM_LIT>:<EOL><INDENT>if isleap(year + YEAR_EPOCH - <NUM_LIT:1>):<EOL><INDENT>assert day <= <NUM_LIT:2><EOL><DEDENT>else:<EOL><INDENT>assert day == <NUM_LIT:1><EOL><DEDENT><DEDENT><DEDENT>except AssertionError:<EOL><INDENT>raise ValueError("<STR_LIT>".format(year, month, day))<EOL><DEDENT>return True<EOL>
Checks if a given date is a legal positivist date