def leap(year, method=None):
method = method or '<STR_LIT>'<EOL>if year in (<NUM_LIT:3>, <NUM_LIT:7>, <NUM_LIT:11>):<EOL><INDENT>return True<EOL><DEDENT>elif year < <NUM_LIT:15>:<EOL><INDENT>return False<EOL><DEDENT>if method in (<NUM_LIT:4>, '<STR_LIT>') or (year <= <NUM_LIT:16> and method in (<NUM_LIT>, '<STR_LIT>', <NUM_LIT:4>, '<STR_LIT>')):<EOL><INDENT>return year % <NUM_LIT:4> == <NUM_LIT:3><EOL><DEDENT>elif method in (<NUM_LIT:100>, '<STR_LIT>'):<EOL><INDENT>return (year % <NUM_LIT:4> == <NUM_LIT:0> and year % <NUM_LIT:100> != <NUM_LIT:0>) or year % <NUM_LIT> == <NUM_LIT:0><EOL><DEDENT>elif method in (<NUM_LIT>, '<STR_LIT>'):<EOL><INDENT>return year % <NUM_LIT:4> == <NUM_LIT:0> and year % <NUM_LIT> != <NUM_LIT:0><EOL><DEDENT>elif method == '<STR_LIT>':<EOL><INDENT>startjd = to_jd(year, <NUM_LIT:1>, <NUM_LIT:1>, method='<STR_LIT>')<EOL>if premier_da_la_annee(startjd + <NUM_LIT>) - startjd == <NUM_LIT>:<EOL><INDENT>return True<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>return False<EOL>
Determine if this is a leap year in the FR calendar using one of three methods: 4, 100, 128
(every 4th years, every 4th or 400th but not 100th, every 4th but not 128th)