def easter(year, method=EASTER_WESTERN):
if not (<NUM_LIT:1> <= method <= <NUM_LIT:3>):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>y = year<EOL>g = y % <NUM_LIT><EOL>e = <NUM_LIT:0><EOL>if method < <NUM_LIT:3>:<EOL><INDENT>i = (<NUM_LIT> * g + <NUM_LIT:15>) % <NUM_LIT:30><EOL>j = (y + y // <NUM_LIT:4> + i) % <NUM_LIT:7><EOL>if method == <NUM_LIT:2>:<EOL><INDENT>e = <NUM_LIT:10><EOL>if y > <NUM_LIT>:<EOL><INDENT>e = e + y // <NUM_LIT:100> - <NUM_LIT:16> - (y // <NUM_LIT:100> - <NUM_LIT:16>) // <NUM_LIT:4><EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>c = y // <NUM_LIT:100><EOL>h = (c - c // <NUM_LIT:4> - (<NUM_LIT:8> * c + <NUM_LIT>) // <NUM_LIT> + <NUM_LIT> * g + <NUM_LIT:15>) % <NUM_LIT:30><EOL>i = h - (h // <NUM_LIT>) * (<NUM_LIT:1> - (h // <NUM_LIT>) *<EOL>(<NUM_LIT> // (h + <NUM_LIT:1>)) * ((<NUM_LIT> - g) // <NUM_LIT:11>))<EOL>j = (y + y // <NUM_LIT:4> + i + <NUM_LIT:2> - c + c // <NUM_LIT:4>) % <NUM_LIT:7><EOL><DEDENT>p = i - j + e<EOL>d = <NUM_LIT:1> + (p + <NUM_LIT> + (p + <NUM_LIT:6>) // <NUM_LIT>) % <NUM_LIT><EOL>m = <NUM_LIT:3> + (p + <NUM_LIT>) // <NUM_LIT:30><EOL>return datetime.date(int(y), int(m), int(d))<EOL>
This method was ported from the work done by GM Arts,
on top of the algorithm by Claus Tondering, which was
based in part on the algorithm of Ouding (1940), as
quoted in "Explanatory Supplement to the Astronomical
Almanac", P.  Kenneth Seidelmann, editor.

This algorithm implements three different easter
calculation methods:

1 - Original calculation in Julian calendar, valid in
    dates after 326 AD
2 - Original method, with date converted to Gregorian
    calendar, valid in years 1583 to 4099
3 - Revised method, in Gregorian calendar, valid in
    years 1583 to 4099 as well

These methods are represented by the constants:

* ``EASTER_JULIAN   = 1``
* ``EASTER_ORTHODOX = 2``
* ``EASTER_WESTERN  = 3``

The default method is method 3.

More about the algorithm may be found at:

http://users.chariot.net.au/~gmarts/eastalg.htm

and

http://www.tondering.dk/claus/calendar.html