def decode_date(self, val):
if isinstance(val, basestring) and val.count('<STR_LIT:->') == <NUM_LIT:2> and len(val) > <NUM_LIT:9>:<EOL><INDENT>try:<EOL><INDENT>dt = dateutil.parser.parse(val)<EOL>if val.endswith(('<STR_LIT>', '<STR_LIT>', '<STR_LIT>')):<EOL><INDENT>dt = dt.replace(tzinfo=None)<EOL><DEDENT>return dt<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>pass<EOL><DEDENT><DEDENT>return val<EOL>
Tries to decode strings that look like dates into datetime objects.