class_docstr: The base class for progress bars in Lightning. It is a :class:`~lightning.pytorch.callbacks.Callback` that keeps
  track of the batch progress in the :class:`~lightning.pytorch.trainer.trainer.Trainer`. You should implement your
  highly custom progress bars with this as the base class.
  
  Example::
  
      class LitProgressBar(ProgressBar):
  
          def __init__(self):
              super().__init__()  # don't forget this :)
              self.enable = True
  
          def disable(self):
              self.enable = False
  
          def on_train_batch_end(self, trainer, pl_module, outputs, batch, batch_idx):
              super().on_train_batch_end(trainer, pl_module, outputs, batch, batch_idx)  # don't forget this :)
              percent = (batch_idx / self.total_train_batches) * 100
              sys.stdout.flush()
              sys.stdout.write(f'{percent:.01f} percent complete \r')
  
      bar = LitProgressBar()
      trainer = Trainer(callbacks=[bar])
class_docstr_tok: ["The","base","class","for","progress","bars","in","Lightning",".","It","is","a",":","class",":","`","~lightning.pytorch.callbacks.Callback","`","that","keeps","track","of","the","batch","progress","in","the",":","class",":","`","~lightning.pytorch.trainer.trainer.Trainer","`",".","You","should","implement","your","highly","custom","progress","bars","with","this","as","the","base","class",".","Example",":",":","class","LitProgressBar","(","ProgressBar",")",":","def","__init__","(","self",")",":","super","(",")",".__init__","(",")","#","do","n't","forget","this",":",")","self.enable","=","True","def","disable","(","self",")",":","self.enable","=","False","def","on_train_batch_end","(","self",",","trainer",",","pl_module",",","outputs",",","batch",",","batch_idx",")",":","super","(",")",".on_train_batch_end","(","trainer",",","pl_module",",","outputs",",","batch",",","batch_idx",")","#","do","n't","forget","this",":",")","percent","=","(","batch_idx","\/","self.total_train_batches",")","*","100","sys.stdout.flush","(",")","sys.stdout.write","(","f","'","{","percent",":",".01f","}","percent","complete","\\r","'",")","bar","=","LitProgressBar","(",")","trainer","=","Trainer","(","callbacks=","[","bar","]",")"]
docstr: Combines progress bar metrics collected from the trainer with standard metrics from get_standard_metrics.
  Implement this to override the items displayed in the progress bar.
  
  Here is an example of how to override the defaults:
  
  .. code-block:: python
  
      def get_metrics(self, trainer, model):
          # don't show the version number
          items = super().get_metrics(trainer, model)
          items.pop("v_num", None)
          return items
  
  Return:
      Dictionary with the items to be displayed in the progress bar.
docstr_tok: ["Combines","progress","bar","metrics","collected","from","the","trainer","with","standard","metrics","from","get_standard_metrics",".","Implement","this","to","override","the","items","displayed","in","the","progress","bar",".","Here","is","an","example","of","how","to","override","the","defaults",":","..","code-block",":",":","python","def","get_metrics","(","self",",","trainer",",","model",")",":","#","do","n't","show","the","version","number","items","=","super","(",")",".get_metrics","(","trainer",",","model",")","items.pop","(","``","v_num","''",",","None",")","return","items","Return",":","Dictionary","with","the","items","to","be","displayed","in","the","progress","bar","."]
code: def get_metrics(
      self, trainer: "pl.Trainer", pl_module: "pl.LightningModule"
  ) -> Dict[str, Union[int, str, float, Dict[str, float]]]:
      r"""Combines progress bar metrics collected from the trainer with standard metrics from get_standard_metrics.
      Implement this to override the items displayed in the progress bar.
  
      Here is an example of how to override the defaults:
  
      .. code-block:: python
  
          def get_metrics(self, trainer, model):
              # don't show the version number
              items = super().get_metrics(trainer, model)
              items.pop("v_num", None)
              return items
  
      Return:
          Dictionary with the items to be displayed in the progress bar.
  
      """
      standard_metrics = get_standard_metrics(trainer)
      pbar_metrics = trainer.progress_bar_metrics
      duplicates = list(standard_metrics.keys() & pbar_metrics.keys())
      if duplicates:
          rank_zero_warn(
              f"The progress bar already tracks a metric with the name(s) '{', '.join(duplicates)}' and"
              f" `self.log('{duplicates[0]}', ..., prog_bar=True)` will overwrite this value. "
              " If this is undesired, change the name or override `get_metrics()` in the progress bar callback.",
          )
  
      return {**standard_metrics, **pbar_metrics}
  
imports: from typing import Any, Dict, Optional, Union
  from typing_extensions import override
  import lightning.pytorch
  from lightning.pytorch.callbacks import Callback
  from lightning.pytorch.utilities.rank_zero import rank_zero_warn
label_desc: Use image node_id 19 for calling the ProgressBar obj's underlying member method code with example usage: obj.get_metrics(trainer, pl_module) and returns: dict