class_docstr: Event that called the completer.
  
  :param text_inserted: When True, it means that completions are requested
      because of a text insert. (`Buffer.complete_while_typing`.)
  :param completion_requested: When True, it means that the user explicitly
      pressed the `Tab` key in order to view the completions.
  
  These two flags can be used for instance to implement a completer that
  shows some completions when ``Tab`` has been pressed, but not
  automatically when the user presses a space. (Because of
  `complete_while_typing`.)
class_docstr_tok: ["Event","that","called","the","completer",".",":","param","text_inserted",":","When","True",",","it","means","that","completions","are","requested","because","of","a","text","insert",".","(","`","Buffer.complete_while_typing","`",".",")",":","param","completion_requested",":","When","True",",","it","means","that","the","user","explicitly","pressed","the","`","Tab","`","key","in","order","to","view","the","completions",".","These","two","flags","can","be","used","for","instance","to","implement","a","completer","that","shows","some","completions","when","``","Tab","``","has","been","pressed",",","but","not","automatically","when","the","user","presses","a","space",".","(","Because","of","`","complete_while_typing","`",".",")"]
code: def __init__(
      self,
      text_inserted: bool = False,
      completion_requested: bool = False,
  ) -> None:
      assert not (text_inserted and completion_requested)
  
      #: Automatic completion while typing.
      self.text_inserted = text_inserted
  
      #: Used explicitly requested completion by pressing 'tab'.
      self.completion_requested = completion_requested
  
imports: from __future__ import annotations
  from abc import ABCMeta, abstractmethod
  from typing import AsyncGenerator, Callable, Iterable, Sequence
  from prompt_toolkit.document import Document
  from prompt_toolkit.eventloop import aclosing, generator_to_async_generator
  from prompt_toolkit.filters import FilterOrBool, to_filter
  from prompt_toolkit.formatted_text import AnyFormattedText, StyleAndTextTuples
label_desc: Use image node_id 1 to create a new CompleteEvent object  with example: obj = CompleteEvent(text_inserted, completion_requested)