Open the context
Choose the project folder and name the files or behavior involved.
Classify Gregorian years from 1 through 9999 as leap years or common years. Check 1900, 2000 and both range endpoints, rejecting year zero, fractions and Boolean values.
Choose the project folder and name the files or behavior involved.
Describe the input, expected output and boundaries that must stay intact.
Review the proposed edits and any commands before relying on their result.
Compare actual behavior with the expected result. If a check fails, investigate it before applying more changes.
def is_leap_year(year):
if type(year) is not int or not 1 <= year <= 9999:
raise ValueError("year.range")
return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)The example is a starting point for a real project, not a claim that generated code is already tested. Adjust paths, dependencies and expected behavior to match your application.