def quarter_boundaries(quarter):
year, quarter = quarter.split('<STR_LIT>')<EOL>year = int(year)<EOL>quarter = int(quarter)<EOL>first_month_of_quarter = <NUM_LIT:3> * quarter - <NUM_LIT:2><EOL>last_month_of_quarter = <NUM_LIT:3> * quarter<EOL>first_day = date(year, first_month_of_quarter, <NUM_LIT:1>)<EOL>last_day = date(year, last_month_of_quarter, monthrange(year, last_month_of_quarter)[<NUM_LIT:1>])<EOL>return first_day, last_day<EOL>
Returns first and last day of a quarter

    Args:
        quarter (str) quarter, in format '2015Q1'

    Returns: (tuple) datetime.dates for the first and last days of the quarter