def is_leap(year):
    """Returns true if the given year is a leap year, false otherwise."""
    # Every year that is exactly divisible by four is a leap year, except for years that are
    # exactly divisible by 100, but these centurial years are leap years, if they are exactly
    # divisible by 400.
    # @see https://www.cse.unsw.edu.au/~cs1511/17s2/week02/09_leapYear/
    if year % 4 == 0:
        if year % 100 == 0:
            return year % 400 == 0
        return True
    return False