code: def _extract_sender(
      message: Message, resent_dates: List[Union[str, Header]] = None
  ) -> str:
      
      if resent_dates:
          sender_header = "Resent-Sender"
          from_header = "Resent-From"
      else:
          sender_header = "Sender"
          from_header = "From"
  
      # Prefer the sender field per RFC 2822:3.6.2.
      if sender_header in message:
          sender = message[sender_header]
      else:
          sender = message[from_header]
  
      return str(sender) if sender else ""
docs: Extract the sender from the message object given.