class_docstr: Generates output from a Message object tree.
  
  This basic generator writes the message to the given file object as plain
  text.
code: def _handle_message(self, msg):
      s = self._new_buffer()
      g = self.clone(s)
      # The payload of a message/rfc822 part should be a multipart sequence
      # of length 1.  The zeroth element of the list should be the Message
      # object for the subpart.  Extract that object, stringify it, and
      # write it out.
      # Except, it turns out, when it's a string instead, which happens when
      # and only when HeaderParser is used on a message of mime type
      # message/rfc822.  Such messages are generated by, for example,
      # Groupwise when forwarding unadorned messages.  (Issue 7970.)  So
      # in that case we just emit the string body.
      payload = msg._payload
      if isinstance(payload, list):
          g.flatten(
              msg.get_payload(0), unixfrom=False, linesep=self._NL
          )
          payload = s.getvalue()
      else:
          payload = self._encode(payload)
      self._fp.write(payload)
  
imports: import re
  import sys
  import time
  import random
  from copy import deepcopy
  from io import StringIO, BytesIO
  from email.utils import _has_surrogates
label_desc: Use image node_id 15 for calling the Generator obj's underlying member method code with example usage: obj._handle_message(msg) without return types