class_docstr: Progress bar context manager.
  
  Usage ::
  
      with ProgressBar(...) as pb:
          for item in pb(data):
              ...
  
  :param title: Text to be displayed above the progress bars. This can be a
      callable or formatted text as well.
  :param formatters: List of :class:`.Formatter` instances.
  :param bottom_toolbar: Text to be displayed in the bottom toolbar. This
      can be a callable or formatted text.
  :param style: :class:`prompt_toolkit.styles.BaseStyle` instance.
  :param key_bindings: :class:`.KeyBindings` instance.
  :param cancel_callback: Callback function that's called when control-c is
      pressed by the user. This can be used for instance to start "proper"
      cancellation if the wrapped code supports it.
  :param file: The file object used for rendering, by default `sys.stderr` is used.
  
  :param color_depth: `prompt_toolkit` `ColorDepth` instance.
  :param output: :class:`~prompt_toolkit.output.Output` instance.
  :param input: :class:`~prompt_toolkit.input.Input` instance.
class_docstr_tok: ["Progress","bar","context","manager",".","Usage",":",":","with","ProgressBar","(","...",")","as","pb",":","for","item","in","pb","(","data",")",":","...",":","param","title",":","Text","to","be","displayed","above","the","progress","bars",".","This","can","be","a","callable","or","formatted","text","as","well",".",":","param","formatters",":","List","of",":","class",":","`",".Formatter","`","instances",".",":","param","bottom_toolbar",":","Text","to","be","displayed","in","the","bottom","toolbar",".","This","can","be","a","callable","or","formatted","text",".",":","param","style",":",":","class",":","`","prompt_toolkit.styles.BaseStyle","`","instance",".",":","param","key_bindings",":",":","class",":","`",".KeyBindings","`","instance",".",":","param","cancel_callback",":","Callback","function","that","'s","called","when","control-c","is","pressed","by","the","user",".","This","can","be","used","for","instance","to","start","``","proper","''","cancellation","if","the","wrapped","code","supports","it",".",":","param","file",":","The","file","object","used","for","rendering",",","by","default","`","sys.stderr","`","is","used",".",":","param","color_depth",":","`","prompt_toolkit","`","`","ColorDepth","`","instance",".",":","param","output",":",":","class",":","`","~prompt_toolkit.output.Output","`","instance",".",":","param","input",":",":","class",":","`","~prompt_toolkit.input.Input","`","instance","."]
code: def __exit__(self, *a: object) -> None:
      # Wait for the app to be started. Make sure we don't quit earlier,
      # otherwise `self.app.exit` won't terminate the app because
      # `self.app.future` has not yet been set.
      self._app_started.wait()
  
      # Quit UI application.
      if self.app.is_running and self.app.loop is not None:
          self.app.loop.call_soon_threadsafe(self.app.exit)
  
      if self._thread is not None:
          self._thread.join()
  
imports: from __future__ import annotations
  import contextvars
  import datetime
  import functools
  import os
  import signal
  import threading
  import traceback
  from typing import Callable, Generic, Iterable, Iterator, Sequence, Sized, TextIO, TypeVar, cast
  from prompt_toolkit.application import Application
  from prompt_toolkit.application.current import get_app_session
  from prompt_toolkit.filters import Condition, is_done, renderer_height_is_known
  from prompt_toolkit.formatted_text import AnyFormattedText, StyleAndTextTuples, to_formatted_text
  from prompt_toolkit.input import Input
  from prompt_toolkit.key_binding import KeyBindings
  from prompt_toolkit.key_binding.key_processor import KeyPressEvent
  from prompt_toolkit.layout import ConditionalContainer, FormattedTextControl, HSplit, Layout, VSplit, Window
  from prompt_toolkit.layout.controls import UIContent, UIControl
  from prompt_toolkit.layout.dimension import AnyDimension, D
  from prompt_toolkit.output import ColorDepth, Output
  from prompt_toolkit.styles import BaseStyle
  from prompt_toolkit.utils import in_main_thread
  from .formatters import Formatter, create_default_formatters
label_desc: Use image node_id 3 for calling the ProgressBar obj's underlying member method code with example usage: obj.__exit__() without return types