def parse_datetime(dt):
d = datetime.strptime(dt[:-<NUM_LIT:1>], ISOFORMAT)<EOL>if dt[-<NUM_LIT:1>:] == '<STR_LIT>':<EOL><INDENT>return timezone('<STR_LIT>').localize(d)<EOL><DEDENT>else:<EOL><INDENT>return d<EOL><DEDENT>
Parse an ISO datetime, which Python does buggily.