def column_name_to_date(name):
month_nums = {'<STR_LIT>': <NUM_LIT:1>, '<STR_LIT>': <NUM_LIT:2>, '<STR_LIT>': <NUM_LIT:3>, '<STR_LIT>': <NUM_LIT:4>, '<STR_LIT>': <NUM_LIT:5>, '<STR_LIT>': <NUM_LIT:6>, '<STR_LIT>': <NUM_LIT:7>,<EOL>'<STR_LIT>': <NUM_LIT:8>, '<STR_LIT>': <NUM_LIT:9>, '<STR_LIT>': <NUM_LIT:10>, '<STR_LIT>': <NUM_LIT:11>, '<STR_LIT>': <NUM_LIT:12>}<EOL>year_month = re.split(r'<STR_LIT>', name.strip().strip('<STR_LIT>'))<EOL>try:<EOL><INDENT>year = int(year_month[<NUM_LIT:0>])<EOL>month = year_month[-<NUM_LIT:1>]<EOL><DEDENT>except (ValueError, IndexError):<EOL><INDENT>year = int(year_month[-<NUM_LIT:1>])<EOL>month = year_month[<NUM_LIT:0>]<EOL><DEDENT>month = int(month_nums.get(str(month).lower().title(), month or <NUM_LIT:0>))<EOL>if <NUM_LIT:0> <= year <= <NUM_LIT> and <NUM_LIT:1> <= month <= <NUM_LIT:12>:<EOL><INDENT>return datetime.date(year, month, <NUM_LIT:1>)<EOL><DEDENT>try:<EOL><INDENT>year = int(year_month[<NUM_LIT:1>])<EOL>month = int(year_month[<NUM_LIT:0>])<EOL><DEDENT>except (ValueError, IndexError):<EOL><INDENT>year. month = <NUM_LIT:0>, <NUM_LIT:0><EOL><DEDENT>if <NUM_LIT:0> <= year <= <NUM_LIT> and <NUM_LIT:1> <= month <= <NUM_LIT:12>:<EOL><INDENT>return datetime.date(year, month, <NUM_LIT:1>)<EOL><DEDENT>try:<EOL><INDENT>month = int(year_month[<NUM_LIT:1>])<EOL>year = int(year_month[<NUM_LIT:0>])<EOL><DEDENT>except (ValueError, IndexError):<EOL><INDENT>year. month = <NUM_LIT:0>, <NUM_LIT:0><EOL><DEDENT>if <NUM_LIT:0> <= year <= <NUM_LIT> and <NUM_LIT:1> <= month <= <NUM_LIT:12>:<EOL><INDENT>return datetime.date(year, month, <NUM_LIT:1>)<EOL><DEDENT>
TODO: should probably assume a 2000 epoch for 2-digit dates

>>> column_name_to_date('10-Apr')
datetime.date(10, 4, 1)
>>> column_name_to_date('10_2011')
datetime.date(2011, 10, 1)
>>> column_name_to_date('apr_10')
datetime.date(10, 4, 1)