Path 1: 12 calls (0.86)

2004 (11) 2001 (1)

2 (2) 1 (1) 3 (1) 4 (1) 5 (1) 6 (1) 7 (1) 8 (1) 9 (1) 10 (1)

(2001, 3) (1) (2004, 2) (1) (2004, 3) (1) (2004, 4) (1) (2004, 5) (1) (2004, 6) (1) (2004, 7) (1) (2004, 8) (1) (2004, 9) (1) (2004, 10) (1)

1def _nextmonth(year, month):
2    if month == 12:
3        return year+1, 1
4    else:
5        return year, month+1
            

Path 2: 2 calls (0.14)

9999 (1) 2004 (1)

12 (2)

(10000, 1) (1) (2005, 1) (1)

1def _nextmonth(year, month):
2    if month == 12:
3        return year+1, 1
4    else:
5        return year, month+1