def is_leap_year(builder, year_val):
 actual_year = builder.add(year_val, Constant.int(DATETIME64, 1970))
 multiple_of_4 = cgutils.is_null(builder, builder.and_(actual_year, Constant.int(DATETIME64, 3)))
 not_multiple_of_100 = cgutils.is_not_null(builder, builder.srem(actual_year, Constant.int(DATETIME64, 100)))
 multiple_of_400 = cgutils.is_null(builder, builder.srem(actual_year, Constant.int(DATETIME64, 400)))
 return builder.and_(multiple_of_4, builder.or_(not_multiple_of_100, multiple_of_400))

def is_leap_year ( builder , year_val ) : actual_year = builder . add ( year_val , Constant . int ( DATETIME64 , 1970 ) ) multiple_of_4 = cgutils . is_null ( builder , builder . and_ ( actual_year , Constant . int ( DATETIME64 , 3 ) ) ) not_multiple_of_100 = cgutils . is_not_null ( builder , builder . srem ( actual_year , Constant . int ( DATETIME64 , 100 ) ) ) multiple_of_400 = cgutils . is_null ( builder , builder . srem ( actual_year , Constant . int ( DATETIME64 , 400 ) ) ) return builder . and_ ( multiple_of_4 , builder . or_ ( not_multiple_of_100 , multiple_of_400 ) )
return a predicate indicating whether *year_val* is a leap year .