class_docstr: Generates output from a Message object tree.
  
  This basic generator writes the message to the given file object as plain
  text.
docstr: Create the generator for message flattening.
  
  outfp is the output file-like object for writing the message to.  It
  must have a write() method.
  
  Optional mangle_from_ is a flag that, when True (the default if policy
  is not set), escapes From_ lines in the body of the message by putting
  a `>' in front of them.
  
  Optional maxheaderlen specifies the longest length for a non-continued
  header.  When a header line is longer (in characters, with tabs
  expanded to 8 spaces) than maxheaderlen, the header will split as
  defined in the Header class.  Set maxheaderlen to zero to disable
  header wrapping.  The default is 78, as recommended (but not required)
  by RFC 2822.
  
  The policy keyword specifies a policy object that controls a number of
  aspects of the generator's operation.  If no policy is specified,
  the policy associated with the Message object passed to the
  flatten method is used.
docstr_tok: ["Create","the","generator","for","message","flattening",".","outfp","is","the","output","file-like","object","for","writing","the","message","to",".","It","must","have","a","write","(",")","method",".","Optional","mangle_from_","is","a","flag","that",",","when","True","(","the","default","if","policy","is","not","set",")",",","escapes","From_","lines","in","the","body","of","the","message","by","putting","a","`",">","'","in","front","of","them",".","Optional","maxheaderlen","specifies","the","longest","length","for","a","non-continued","header",".","When","a","header","line","is","longer","(","in","characters",",","with","tabs","expanded","to","8","spaces",")","than","maxheaderlen",",","the","header","will","split","as","defined","in","the","Header","class",".","Set","maxheaderlen","to","zero","to","disable","header","wrapping",".","The","default","is","78",",","as","recommended","(","but","not","required",")","by","RFC","2822",".","The","policy","keyword","specifies","a","policy","object","that","controls","a","number","of","aspects","of","the","generator","'s","operation",".","If","no","policy","is","specified",",","the","policy","associated","with","the","Message","object","passed","to","the","flatten","method","is","used","."]
code: def __init__(
      self, outfp, mangle_from_=None, maxheaderlen=None, *, policy=None
  ):
      """Create the generator for message flattening.
  
      outfp is the output file-like object for writing the message to.  It
      must have a write() method.
  
      Optional mangle_from_ is a flag that, when True (the default if policy
      is not set), escapes From_ lines in the body of the message by putting
      a `>' in front of them.
  
      Optional maxheaderlen specifies the longest length for a non-continued
      header.  When a header line is longer (in characters, with tabs
      expanded to 8 spaces) than maxheaderlen, the header will split as
      defined in the Header class.  Set maxheaderlen to zero to disable
      header wrapping.  The default is 78, as recommended (but not required)
      by RFC 2822.
  
      The policy keyword specifies a policy object that controls a number of
      aspects of the generator's operation.  If no policy is specified,
      the policy associated with the Message object passed to the
      flatten method is used.
  
      """
  
      if mangle_from_ is None:
          mangle_from_ = True if policy is None else policy.mangle_from_
      self._fp = outfp
      self._mangle_from_ = mangle_from_
      self.maxheaderlen = maxheaderlen
      self.policy = policy
  
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 1 to create a new Generator object  with example: obj = Generator(outfp, mangle_from_, maxheaderlen)