def days_in_month(month, leap):
    """
    Return the number of days in a month
    Parameters
    ----------
    month: int
        The month (starting at 0 for January)
    leap: boolean
        Whether it's a leap year
    """
    res = 31
    if month == 1:
        if leap:
            res = 29
        else:
            res = 28
    elif month < 7 and month % 2 == 1:
        res = 30
    elif month >= 7 and month % 2 == 0:
        res = 30
    return res