def month_to_index(year, month):
 assert (12 >= month >= 1)
 return ((((year - 1) * 12) + month) - 1)

def month_to_index ( year , month ) : assert ( 12 >= month >= 1 ) return ( ( ( ( year - 1 ) * 12 ) + month ) - 1 )
convert a year and month to a single value: the number of months between this month and 1 ad .