class_docstr: A feed-style parser of email.
docstr: _factory is called with no arguments to create a new message obj
  
  The policy keyword specifies a policy object that controls a number of
  aspects of the parser's operation.  The default policy maintains
  backward compatibility.
docstr_tok: ["_factory","is","called","with","no","arguments","to","create","a","new","message","obj","The","policy","keyword","specifies","a","policy","object","that","controls","a","number","of","aspects","of","the","parser","'s","operation",".","The","default","policy","maintains","backward","compatibility","."]
code: def __init__(self, _factory=None, *, policy=compat32):
      """_factory is called with no arguments to create a new message obj
  
      The policy keyword specifies a policy object that controls a number of
      aspects of the parser's operation.  The default policy maintains
      backward compatibility.
  
      """
      self.policy = policy
      self._old_style_factory = False
      if _factory is None:
          if policy.message_factory is None:
              from email.message import Message
  
              self._factory = Message
          else:
              self._factory = policy.message_factory
      else:
          self._factory = _factory
          try:
              _factory(policy=self.policy)
          except TypeError:
              # Assume this is an old-style factory
              self._old_style_factory = True
      self._input = BufferedSubFile()
      self._msgstack = []
      self._parse = self._parsegen().__next__
      self._cur = None
      self._last = None
      self._headersonly = False
  
imports: import re
  from email import errors
  from email._policybase import compat32
  from collections import deque
  from io import StringIO
label_desc: Use image node_id 1 to create a new FeedParser object  with example: obj = FeedParser(_factory)