def _parse_date_rfc822(dateString):
data = dateString.split()<EOL>if data[<NUM_LIT:0>][-<NUM_LIT:1>] in ('<STR_LIT:U+002C>', '<STR_LIT:.>') or data[<NUM_LIT:0>].lower() in _daynames:<EOL><INDENT>del data[<NUM_LIT:0>]<EOL><DEDENT>if len(data) == <NUM_LIT:4>:<EOL><INDENT>s = data[<NUM_LIT:3>]<EOL>s = s.split('<STR_LIT:+>', <NUM_LIT:1>)<EOL>if len(s) == <NUM_LIT:2>:<EOL><INDENT>data[<NUM_LIT:3>:] = s<EOL><DEDENT>else:<EOL><INDENT>data.append('<STR_LIT>')<EOL><DEDENT>dateString = "<STR_LIT:U+0020>".join(data)<EOL><DEDENT>if len(data) < <NUM_LIT:5>:<EOL><INDENT>dateString += '<STR_LIT>'<EOL><DEDENT>return email.utils.parsedate_tz(dateString)<EOL>
Parse an RFC822, RFC1123, RFC2822, or asctime-style date