def rfc2822_datetime(s):
date_tuple = parsedate(s)<EOL>if date_tuple is None:<EOL><INDENT>return None<EOL><DEDENT>return datetime.datetime(*date_tuple[:<NUM_LIT:6>]).replace(tzinfo=pytz.utc)<EOL>
Parses an RFC 2822 date string and returns a UTC datetime object,
or the string if parsing failed.
:param s: RFC 2822-formatted string date
:return: datetime or str