code: def clean_message(message: Message, topmost: bool = False) -> Message:
      
      if message.is_multipart():
          # Don't recurse in already-deleted attachments
          if message.get_content_type() != 'message/external-body':
              parts = message.get_payload()
              parts[:] = map(clean_message, parts)
      elif message_is_binary(message):
          # Don't gut if this is the topmost message
          if not topmost:
              message = gut_message(message)
  
      return message
docs: Clean a message of all its binary parts.
  
      This guts all binary attachments, and returns the message itself for
      convenience.