code: def dt_from_header(date_str):
      
      convert_fns = (
          dt_from_rfc8601,
          dt_from_rfc1123,
      )
  
      for convert_fn in convert_fns:
          try:
              return convert_fn(date_str)
          except ValueError:
              pass
  
      return None
docs: Try various RFC conversions to ``datetime`` or return ``None``.
  
      :param date_str: Date string.
      :type  date_str: ``string``
      :return: Date time.
      :rtype:  :class:`datetime.datetime` or ``None``