def quarter_to_daterange(quarter):
assert len(quarter) == <NUM_LIT:6><EOL>year = int(quarter[<NUM_LIT:0>:<NUM_LIT:4>])<EOL>quarter = quarter[<NUM_LIT:5>]<EOL>MONTH_DAY = {<EOL>'<STR_LIT:1>': ((<NUM_LIT:1>, <NUM_LIT:1>), (<NUM_LIT:3>, <NUM_LIT>)),<EOL>'<STR_LIT:2>': ((<NUM_LIT:4>, <NUM_LIT:1>), (<NUM_LIT:6>, <NUM_LIT:30>)),<EOL>'<STR_LIT:3>': ((<NUM_LIT:7>, <NUM_LIT:1>), (<NUM_LIT:9>, <NUM_LIT:30>)),<EOL>'<STR_LIT:4>': ((<NUM_LIT:10>, <NUM_LIT:1>), (<NUM_LIT:12>, <NUM_LIT>))<EOL>}<EOL>md = MONTH_DAY[quarter]<EOL>start_md, end_md = md<EOL>return (<EOL>date(year, *start_md),<EOL>date(year, *end_md)<EOL>)<EOL>
Convert a quarter in arbitrary filename-ready format (e.g. 2015Q1)
    into start and end datetimes