def _month_bounds(date):
 first_day = date.replace(day=1)
 if (first_day.month == 12):
  last_day = first_day.replace(year=(first_day.year + 1), month=1)
 else:
  last_day = first_day.replace(month=(first_day.month + 1))
 return (first_day, last_day)

def _month_bounds ( date ) : first_day = date . replace ( day = 1 ) if ( first_day . month == 12 ) : last_day = first_day . replace ( year = ( first_day . year + 1 ) , month = 1 ) else : last_day = first_day . replace ( month = ( first_day . month + 1 ) ) return ( first_day , last_day )
helper: return the first and last days of the month for the given date .