class_docstr: This is the default progress bar used by Lightning. It prints to ``stdout`` using the :mod:`tqdm` package and
  shows up to four different bars:
  
      - **sanity check progress:** the progress during the sanity check run
      - **train progress:** shows the training progress. It will pause if validation starts and will resume
        when it ends, and also accounts for multiple validation runs during training when
        :paramref:`~lightning.pytorch.trainer.trainer.Trainer.val_check_interval` is used.
      - **validation progress:** only visible during validation;
        shows total progress over all validation datasets.
      - **test progress:** only active when testing; shows total progress over all test datasets.
  
  For infinite datasets, the progress bar never ends.
  
  If you want to customize the default ``tqdm`` progress bars used by Lightning, you can override
  specific methods of the callback class and pass your custom implementation to the
  :class:`~lightning.pytorch.trainer.trainer.Trainer`.
  
  Example:
  
      >>> class LitProgressBar(TQDMProgressBar):
      ...     def init_validation_tqdm(self):
      ...         bar = super().init_validation_tqdm()
      ...         bar.set_description('running validation ...')
      ...         return bar
      ...
      >>> bar = LitProgressBar()
      >>> from lightning.pytorch import Trainer
      >>> trainer = Trainer(callbacks=[bar])
  
  Args:
      refresh_rate: Determines at which rate (in number of batches) the progress bars get updated.
          Set it to ``0`` to disable the display.
      process_position: Set this to a value greater than ``0`` to offset the progress bars by this many lines.
          This is useful when you have progress bars defined elsewhere and want to show all of them
          together. This corresponds to
          :paramref:`~lightning.pytorch.trainer.trainer.Trainer.process_position` in the
          :class:`~lightning.pytorch.trainer.trainer.Trainer`.
class_docstr_tok: ["This","is","the","default","progress","bar","used","by","Lightning",".","It","prints","to","``","stdout","``","using","the",":","mod",":","`","tqdm","`","package","and","shows","up","to","four","different","bars",":","-","*","*","sanity","check","progress",":","*","*","the","progress","during","the","sanity","check","run","-","*","*","train","progress",":","*","*","shows","the","training","progress",".","It","will","pause","if","validation","starts","and","will","resume","when","it","ends",",","and","also","accounts","for","multiple","validation","runs","during","training","when",":","paramref",":","`","~lightning.pytorch.trainer.trainer.Trainer.val_check_interval","`","is","used",".","-","*","*","validation","progress",":","*","*","only","visible","during","validation",";","shows","total","progress","over","all","validation","datasets",".","-","*","*","test","progress",":","*","*","only","active","when","testing",";","shows","total","progress","over","all","test","datasets",".","For","infinite","datasets",",","the","progress","bar","never","ends",".","If","you","want","to","customize","the","default","``","tqdm","``","progress","bars","used","by","Lightning",",","you","can","override","specific","methods","of","the","callback","class","and","pass","your","custom","implementation","to","the",":","class",":","`","~lightning.pytorch.trainer.trainer.Trainer","`",".","Example",":",">",">",">","class","LitProgressBar","(","TQDMProgressBar",")",":","...","def","init_validation_tqdm","(","self",")",":","...","bar","=","super","(",")",".init_validation_tqdm","(",")","...","bar.set_description","(","'running","validation","...","'",")","...","return","bar","...",">",">",">","bar","=","LitProgressBar","(",")",">",">",">","from","lightning.pytorch","import","Trainer",">",">",">","trainer","=","Trainer","(","callbacks=","[","bar","]",")","Args",":","refresh_rate",":","Determines","at","which","rate","(","in","number","of","batches",")","the","progress","bars","get","updated",".","Set","it","to","``","0","``","to","disable","the","display",".","process_position",":","Set","this","to","a","value","greater","than","``","0","``","to","offset","the","progress","bars","by","this","many","lines",".","This","is","useful","when","you","have","progress","bars","defined","elsewhere","and","want","to","show","all","of","them","together",".","This","corresponds","to",":","paramref",":","`","~lightning.pytorch.trainer.trainer.Trainer.process_position","`","in","the",":","class",":","`","~lightning.pytorch.trainer.trainer.Trainer","`","."]
code: def test_progress_bar(self, bar: _tqdm) -> None:
      self._test_progress_bar = bar
  
imports: import importlib
  import math
  import os
  import sys
  from typing import Any, Dict, Optional, Union
  from typing_extensions import override
  from lightning.pytorch.utilities.types import STEP_OUTPUT
  import lightning.pytorch
  from lightning.pytorch.callbacks.progress.progress_bar import ProgressBar
  from lightning.pytorch.utilities.rank_zero import rank_zero_debug
label_desc: Use image node_id 8 for calling the TQDMProgressBar obj's underlying member method code with example usage: obj.test_progress_bar(bar) without return types